Bug 901898 - Remove codesighs now that it's no longer run in automation; r=gps
authorEd Morley <emorley@mozilla.com>
Mon, 12 Aug 2013 13:10:41 +0100
changeset 142230 2654301601dd19e353864f9bce85ef2f009a6274
parent 142229 ce87bb4db33fe7fe2d760686338d6ae6696114ee
child 142231 c9f93acbf43aa02ebbd2475ff03ddf512b190844
push id32340
push useremorley@mozilla.com
push dateMon, 12 Aug 2013 12:10:55 +0000
treeherdermozilla-inbound@2654301601dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs901898
milestone26.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 901898 - Remove codesighs now that it's no longer run in automation; r=gps
Makefile.in
b2g/config/mozconfigs/linux32_gecko/nightly
b2g/config/mozconfigs/linux64_gecko/nightly
b2g/config/mozconfigs/macosx64_gecko/nightly
browser/config/mozconfigs/linux32/nightly
browser/config/mozconfigs/linux32/nightly-asan
browser/config/mozconfigs/linux64/nightly
browser/config/mozconfigs/linux64/nightly-asan
browser/config/mozconfigs/macosx-universal/nightly
browser/config/mozconfigs/whitelist
config/rules.mk
configure.in
js/src/config/rules.mk
js/src/configure.in
rdf/tests/rdfcat/Makefile.in
rdf/tests/triplescat/Makefile.in
toolkit/mozapps/installer/packager.mk
toolkit/toolkit.mozbuild
tools/codesighs/Makefile.in
tools/codesighs/autosummary.unix.bash
tools/codesighs/autosummary.win.bash
tools/codesighs/codesighs.c
tools/codesighs/codesighs.py
tools/codesighs/maptsvdifftool.c
tools/codesighs/moz.build
tools/codesighs/msdump2symdb.c
tools/codesighs/msmap.h
tools/codesighs/msmap2tsv.c
tools/codesighs/nm2tsv.c
tools/codesighs/nm_wrap_osx.pl
tools/codesighs/readelf_wrap.pl
tools/performance/diff-talos.py
--- a/Makefile.in
+++ b/Makefile.in
@@ -163,19 +163,16 @@ ifdef MOZ_CRASHREPORTER
           zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"  -x "*test*" -x "*Test*"
 endif # MOZ_CRASHREPORTER
 
 uploadsymbols:
 ifdef MOZ_CRASHREPORTER
 	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
 endif
 
-codesighs:
-	$(MAKE) -C $(MOZ_BUILD_APP)/installer codesighs
-
 # defined in package-name.mk
 export MOZ_SOURCE_STAMP
 
 #XXX: this is a hack, since we don't want to clobber for MSVC
 # PGO support, but we can't do this test in client.mk
 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
 # No point in clobbering if PGO has been explicitly disabled.
 ifndef NO_PROFILE_GUIDED_OPTIMIZE
--- a/b2g/config/mozconfigs/linux32_gecko/nightly
+++ b/b2g/config/mozconfigs/linux32_gecko/nightly
@@ -1,14 +1,13 @@
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux32"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --enable-codesighs
 ac_add_options --enable-signmar
 
 # Nightlies only since this has a cost in performance
 #ac_add_options --enable-js-diagnostics
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
--- a/b2g/config/mozconfigs/linux64_gecko/nightly
+++ b/b2g/config/mozconfigs/linux64_gecko/nightly
@@ -1,14 +1,13 @@
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux"
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --enable-codesighs
 ac_add_options --enable-signmar
 
 # Nightlies only since this has a cost in performance
 #ac_add_options --enable-js-diagnostics
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
--- a/b2g/config/mozconfigs/macosx64_gecko/nightly
+++ b/b2g/config/mozconfigs/macosx64_gecko/nightly
@@ -1,13 +1,12 @@
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --enable-codesighs
 ac_add_options --enable-signmar
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
--- a/browser/config/mozconfigs/linux32/nightly
+++ b/browser/config/mozconfigs/linux32/nightly
@@ -1,11 +1,10 @@
 . "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
 
-ac_add_options --enable-codesighs
 ac_add_options --enable-signmar
 ac_add_options --enable-profiling
 ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 # This will overwrite the default of stripping everything and keep the symbol table.
--- a/browser/config/mozconfigs/linux32/nightly-asan
+++ b/browser/config/mozconfigs/linux32/nightly-asan
@@ -1,18 +1,15 @@
 # We still need to build with debug symbols
 ac_add_options --disable-debug
 ac_add_options --enable-optimize="-O2 -g"
 
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 
-# Other options
-ac_add_options --enable-codesighs
-
 . $topsrcdir/build/unix/mozconfig.asan
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL=asan
 
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -1,11 +1,10 @@
 . "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
 
-ac_add_options --enable-codesighs
 ac_add_options --enable-signmar
 ac_add_options --enable-profiling
 ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 # This will overwrite the default of stripping everything and keep the symbol table.
--- a/browser/config/mozconfigs/linux64/nightly-asan
+++ b/browser/config/mozconfigs/linux64/nightly-asan
@@ -1,18 +1,15 @@
 # We still need to build with debug symbols
 ac_add_options --disable-debug
 ac_add_options --enable-optimize="-O2 -g"
 
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 
-# Other options
-ac_add_options --enable-codesighs
-
 . $topsrcdir/build/unix/mozconfig.asan
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL=asan
 
--- a/browser/config/mozconfigs/macosx-universal/nightly
+++ b/browser/config/mozconfigs/macosx-universal/nightly
@@ -1,11 +1,10 @@
 . "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
 
-ac_add_options --enable-codesighs
 ac_add_options --disable-install-strip
 ac_add_options --enable-signmar
 ac_add_options --enable-profiling
 ac_add_options --enable-instruments
 ac_add_options --enable-dtrace
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
--- a/browser/config/mozconfigs/whitelist
+++ b/browser/config/mozconfigs/whitelist
@@ -11,17 +11,16 @@ for platform in all_platforms:
     whitelist['nightly'][platform] = [
         'ac_add_options --enable-update-channel=nightly',
         'ac_add_options --enable-profiling',
         'mk_add_options CLIENT_PY_ARGS="--hg-options=\'--verbose --time\' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"'
     ]
 
 for platform in ['linux32', 'linux64', 'macosx-universal']:
     whitelist['nightly'][platform] += [
-        'ac_add_options --enable-codesighs',
         'mk_add_options MOZ_MAKE_FLAGS="-j4"',
     ]
 
 for platform in ['linux32', 'linux64', 'macosx-universal', 'win32']:
     whitelist['nightly'][platform] += ['ac_add_options --enable-signmar']
     whitelist['nightly'][platform] += ['ac_add_options --enable-js-diagnostics']
 
 whitelist['nightly']['linux32'] += [
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -319,33 +319,21 @@ else
 COMPILE_PDBFILE = generated.pdb
 endif
 
 LINK_PDBFILE = $(basename $(@F)).pdb
 ifdef MOZ_DEBUG
 CODFILE=$(basename $(@F)).cod
 endif
 
-ifdef MOZ_MAPINFO
-ifdef SHARED_LIBRARY_NAME
-MAPFILE=$(SHARED_LIBRARY_NAME).map
-else
-MAPFILE=$(basename $(@F)).map
-endif # SHARED_LIBRARY_NAME
-endif # MOZ_MAPINFO
-
 ifdef DEFFILE
 OS_LDFLAGS += -DEF:$(call normalizepath,$(DEFFILE))
 EXTRA_DEPS += $(DEFFILE)
 endif
 
-ifdef MAPFILE
-OS_LDFLAGS += -MAP:$(MAPFILE)
-endif
-
 else #!GNU_CC
 
 ifdef DEFFILE
 OS_LDFLAGS += $(call normalizepath,$(DEFFILE))
 EXTRA_DEPS += $(DEFFILE)
 endif
 
 endif # !GNU_CC
@@ -394,17 +382,17 @@ HOST_OBJS = $(strip $(_HOST_OBJS))
 endif
 
 ALL_TRASH = \
 	$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
 	$(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \
 	$(OBJS:.$(OBJ_SUFFIX)=.i) $(OBJS:.$(OBJ_SUFFIX)=.i_o) \
 	$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
 	$(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \
-	$(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \
+	$(wildcard *.pdb) $(CODFILE) $(IMPORT_LIBRARY) \
 	$(SHARED_LIBRARY:$(DLL_SUFFIX)=.exp) $(wildcard *.ilk) \
 	$(PROGRAM:$(BIN_SUFFIX)=.exp) $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.exp) \
 	$(PROGRAM:$(BIN_SUFFIX)=.lib) $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.lib) \
 	$(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX)) \
 	$(wildcard gts_tmp_*) $(LIBRARY:%.a=.%.timestamp)
 ALL_TRASH_DIRS = \
 	$(GARBAGE_DIRS) /no-such-file
 
--- a/configure.in
+++ b/configure.in
@@ -7563,31 +7563,16 @@ MOZ_ARG_ENABLE_BOOL(reflow-perf,
 [  --enable-reflow-perf    Enable reflow performance tracing],
     MOZ_REFLOW_PERF=1,
     MOZ_REFLOW_PERF= )
 if test -n "$MOZ_REFLOW_PERF"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
 fi
 
 dnl ========================================================
-dnl Enable code size metrics.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(codesighs,
-[  --enable-codesighs      Enable code size analysis tools],
-    _ENABLE_CODESIGHS=1,
-    _ENABLE_CODESIGHS= )
-if test -n "$_ENABLE_CODESIGHS"; then
-    if test -d $srcdir/tools/codesighs; then
-        MOZ_MAPINFO=1
-    else
-        AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
-    fi
-fi
-
-dnl ========================================================
 dnl = Enable Radio Interface for B2G (Gonk usually)
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(b2g-ril,
 [  --enable-b2g-ril      Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
     MOZ_B2G_RIL=1,
     MOZ_B2G_RIL= )
 if test -n "$MOZ_B2G_RIL"; then
     AC_DEFINE(MOZ_B2G_RIL)
@@ -8769,17 +8754,16 @@ dnl policy alert), set MOZ_DATA_REPORTIN
 dnl We need SUBST for build system and DEFINE for xul preprocessor.
 if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"; then
   MOZ_DATA_REPORTING=1
   AC_DEFINE(MOZ_DATA_REPORTING)
   AC_SUBST(MOZ_DATA_REPORTING)
 fi
 
 dnl win32 options
-AC_SUBST(MOZ_MAPINFO)
 AC_SUBST(MOZ_BROWSE_INFO)
 AC_SUBST(MOZ_TOOLS_DIR)
 AC_SUBST(WIN32_REDIST_DIR)
 AC_SUBST(MAKENSISU)
 
 dnl Echo the CFLAGS to remove extra whitespace.
 CFLAGS=`echo \
 	$_WARNINGS_CFLAGS \
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -319,33 +319,21 @@ else
 COMPILE_PDBFILE = generated.pdb
 endif
 
 LINK_PDBFILE = $(basename $(@F)).pdb
 ifdef MOZ_DEBUG
 CODFILE=$(basename $(@F)).cod
 endif
 
-ifdef MOZ_MAPINFO
-ifdef SHARED_LIBRARY_NAME
-MAPFILE=$(SHARED_LIBRARY_NAME).map
-else
-MAPFILE=$(basename $(@F)).map
-endif # SHARED_LIBRARY_NAME
-endif # MOZ_MAPINFO
-
 ifdef DEFFILE
 OS_LDFLAGS += -DEF:$(call normalizepath,$(DEFFILE))
 EXTRA_DEPS += $(DEFFILE)
 endif
 
-ifdef MAPFILE
-OS_LDFLAGS += -MAP:$(MAPFILE)
-endif
-
 else #!GNU_CC
 
 ifdef DEFFILE
 OS_LDFLAGS += $(call normalizepath,$(DEFFILE))
 EXTRA_DEPS += $(DEFFILE)
 endif
 
 endif # !GNU_CC
@@ -394,17 +382,17 @@ HOST_OBJS = $(strip $(_HOST_OBJS))
 endif
 
 ALL_TRASH = \
 	$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
 	$(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \
 	$(OBJS:.$(OBJ_SUFFIX)=.i) $(OBJS:.$(OBJ_SUFFIX)=.i_o) \
 	$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
 	$(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \
-	$(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \
+	$(wildcard *.pdb) $(CODFILE) $(IMPORT_LIBRARY) \
 	$(SHARED_LIBRARY:$(DLL_SUFFIX)=.exp) $(wildcard *.ilk) \
 	$(PROGRAM:$(BIN_SUFFIX)=.exp) $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.exp) \
 	$(PROGRAM:$(BIN_SUFFIX)=.lib) $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.lib) \
 	$(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX)) \
 	$(wildcard gts_tmp_*) $(LIBRARY:%.a=.%.timestamp)
 ALL_TRASH_DIRS = \
 	$(GARBAGE_DIRS) /no-such-file
 
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4067,17 +4067,16 @@ AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 
 AC_SUBST(MOZILLA_OFFICIAL)
 
 dnl win32 options
-AC_SUBST(MOZ_MAPINFO)
 AC_SUBST(MOZ_BROWSE_INFO)
 AC_SUBST(MOZ_TOOLS_DIR)
 
 dnl Echo the CFLAGS to remove extra whitespace.
 CFLAGS=`echo \
 	$_WARNINGS_CFLAGS \
 	$CFLAGS`
 
--- a/rdf/tests/rdfcat/Makefile.in
+++ b/rdf/tests/rdfcat/Makefile.in
@@ -12,15 +12,11 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBS		= \
 		$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
 		$(LIBS_DIR) \
 		$(XPCOM_LIBS) \
 		$(NSPR_LIBS) \
 		$(NULL)
 
-ifeq ($(OS_ARCH),WINNT)
-MAPFILE=rdfcat.map
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += $(TK_CFLAGS)
--- a/rdf/tests/triplescat/Makefile.in
+++ b/rdf/tests/triplescat/Makefile.in
@@ -12,15 +12,11 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBS		= \
 		$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
 		$(LIBS_DIR) \
 		$(XPCOM_LIBS) \
 		$(NSPR_LIBS) \
 		$(NULL)
 
-ifeq ($(OS_ARCH),WINNT)
-MAPFILE=triplescat.map
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += $(TK_CFLAGS)
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -508,17 +508,16 @@ NO_PKG_FILES += \
 	core \
 	bsdecho \
 	js \
 	js-config \
 	jscpucfg \
 	nsinstall \
 	viewer \
 	TestGtkEmbed \
-	codesighs* \
 	elf-dynstr-gc \
 	mangle* \
 	maptsv* \
 	mfc* \
 	msdump* \
 	msmap* \
 	nm2tsv* \
 	nsinstall* \
@@ -813,26 +812,16 @@ checksum:
 	$(SIGN_CHECKSUM_CMD)
 
 
 upload: checksum
 	$(PYTHON) $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) \
 		$(UPLOAD_FILES) \
 		$(CHECKSUM_FILES)
 
-ifeq (WINNT,$(OS_TARGET))
-CODESIGHS_PACKAGE = $(INSTALLER_PACKAGE)
-else
-CODESIGHS_PACKAGE = $(DIST)/$(PACKAGE)
-endif
-
-codesighs:
-	$(PYTHON) $(topsrcdir)/tools/codesighs/codesighs.py \
-	  "$(DIST)/$(MOZ_PKG_DIR)" "$(CODESIGHS_PACKAGE)"
-
 ifndef MOZ_PKG_SRCDIR
 MOZ_PKG_SRCDIR = $(topsrcdir)
 endif
 
 DIR_TO_BE_PACKAGED ?= ../$(notdir $(topsrcdir))
 SRC_TAR_EXCLUDE_PATHS += \
   --exclude=".hg*" \
   --exclude="CVS" \
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -172,19 +172,16 @@ if CONFIG['MOZ_ENABLE_GNOME_COMPONENT']:
     add_tier_dir('platform', 'toolkit/system/gnome')
 
 # if libconic or QtNetwork is present, it will do its own network monitoring
 if not CONFIG['MOZ_ENABLE_LIBCONIC'] and not CONFIG['MOZ_ENABLE_QTNETWORK'] and CONFIG['MOZ_ENABLE_DBUS']:
     add_tier_dir('platform', 'toolkit/system/dbus')
 
 add_tier_dir('platform', 'addon-sdk')
 
-if CONFIG['MOZ_MAPINFO']:
-    add_tier_dir('platform', 'tools/codesighs')
-
 if CONFIG['ENABLE_MARIONETTE'] or CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('gonk', 'android'):
     add_tier_dir('platform', 'testing/marionette')
 
 if CONFIG['ENABLE_TESTS']:
     add_tier_dir('platform', [
         'testing/mochitest',
         'testing/xpcshell',
         'testing/tools/screenshot',
deleted file mode 100644
--- a/tools/codesighs/Makefile.in
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-
-DISABLED_CSRCS += \
-		codesighs.c \
-		maptsvdifftool.c \
-		$(NULL)
-
-ifeq ($(OS_ARCH),WINNT)
-DISABLED_CSRCS += \
-		msmap2tsv.c \
-		msdump2symdb.c \
-		$(NULL)
-else
-DISABLED_CSRCS += \
-		nm2tsv.c \
-		$(NULL)
-endif
-
-DISABLED_SIMPLE_PROGRAMS = $(CSRCS:.c=$(BIN_SUFFIX))
-
-include $(topsrcdir)/config/config.mk
-
-ifeq ($(OS_ARCH),WINNT)
-OS_LIBS += \
-		imagehlp.lib \
-		$(NULL)
-endif
-
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100755
--- a/tools/codesighs/autosummary.unix.bash
+++ /dev/null
@@ -1,215 +0,0 @@
-#!/bin/bash
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#
-# Check for optional objdir
-# 
-if [ "$1" = "-o" ]; then 
-OBJROOT="$2"
-shift
-shift
-else
-OBJROOT="./mozilla"
-fi
-
-if [ "$1" = "-s" ]; then 
-SRCROOT="$2"
-shift
-shift
-else
-SRCROOT="./mozilla"
-fi
-
-#
-#   A little help for my friends.
-#
-if [ "-h" == "$1" ];then 
-    SHOWHELP="1"
-fi
-if [ "--help" == "$1" ];then 
-    SHOWHELP="1"
-fi
-if [ "" == "$1" ]; then
-    SHOWHELP="1"
-fi
-if [ "" == "$2" ]; then
-    SHOWHELP="1"
-fi
-if [ "" == "$3" ]; then
-    SHOWHELP="1"
-fi
-
-
-#
-#   Show the help if required.
-#
-if [ $SHOWHELP ]; then
-    echo "usage: $0 <save_results> <old_results> <summary>"
-    echo "  <save_results> is a file that will receive the results of this run."
-    echo "    This file can be used in a future run as the old results."
-    echo "  <old_results> is a results file from a previous run."
-    echo "    It is used to diff with current results and come up with a summary"
-    echo "      of changes."
-    echo "    It is OK if the file does not exist, just supply the argument."
-    echo "  <summary> is a file which will contain a human readable report."
-    echo "    This file is most useful by providing more information than the"
-    echo "      normally single digit output of this script."
-    echo ""
-    echo "Run this command from the parent directory of the mozilla tree."
-    echo ""
-    echo "This command will output two numbers to stdout that will represent"
-    echo "  the total size of all code and data, and a delta from the prior."
-    echo "  the old results."
-    echo "For much more detail on size drifts refer to the summary report."
-    echo ""
-    echo "This tool reports on all executables in the directory tree."
-    exit
-fi
-
-#
-#   Stash our arguments away.
-#
-COPYSORTTSV="$1"
-OLDTSVFILE="$2"
-SUMMARYFILE="$3"
-
-OSTYPE=`uname -s`
-
-#
-#   On Mac OS X, use the --zerodrift option to maptsvdifftool
-#
-if [ $OSTYPE == "Darwin" ]; then
-ZERODRIFT="--zerodrift"
-else
-ZERODRIFT=""
-fi
-
-#
-#   Create our temporary directory.
-#   mktemp on Darwin doesn't support -d (suckage)
-#
-if [ $OSTYPE == "Darwin" ]; then
-ZERODRIFT="--zerodrift"
-MYTMPDIR=`mktemp ./codesighs.tmp.XXXXXXXX`
-rm $MYTMPDIR
-mkdir $MYTMPDIR
-else
-MYTMPDIR=`mktemp -d ./codesighs.tmp.XXXXXXXX`
-fi
-
-#
-#   Find all relevant files.
-#
-ALLFILES="$MYTMPDIR/allfiles.list"
-
-if [ $OSTYPE == "Darwin" ] || [ $OSTYPE == "SunOS" ]; then
-find $OBJROOT/dist/bin ! -type d > $ALLFILES
-else
-find $OBJROOT/dist/bin -not -type d > $ALLFILES
-fi
-
-# Check whether we have 'eu-readelf' or 'readelf' available.
-# If we do, it will give more accurate symbol sizes than nm.
-
-if [ $OSTYPE == "Darwin" ]; then
-  USE_READELF=
-else
-READELF_PROG=`which eu-readelf 2>/dev/null | grep /eu-readelf$`
-if test "$READELF_PROG"; then
-  USE_READELF=1
-else
-  READELF_PROG=`which readelf 2>/dev/null | grep /readelf$`
-  if test "$READELF_PROG"; then
-    # Check whether we need -W
-    if readelf --help | grep "\--wide" >&/dev/null; then
-      READELF_PROG="readelf -W"
-    else
-      READELF_PROG="readelf"
-    fi
-    USE_READELF=1
-  else
-    USE_READELF=
-  fi
-fi
-fi
-
-RAWTSVFILE="$MYTMPDIR/raw.tsv"
-if test "$USE_READELF"; then
-export READELF_PROG
-xargs -n 1 $SRCROOT/tools/codesighs/readelf_wrap.pl < $ALLFILES > $RAWTSVFILE 2> /dev/null
-else
-
-#
-#   Produce the cumulative nm output.
-#   We are very particular on what switches to use.
-#   nm --format=bsd --size-sort --print-file-name --demangle
-#
-#   Darwin (Mac OS X) has a lame nm that we have to wrap in a perl
-#   script to get decent output.
-#
-NMRESULTS="$MYTMPDIR/nm.txt"
-if [ $OSTYPE == "Darwin" ]; then
-xargs -n 1 $SRCROOT/tools/codesighs/nm_wrap_osx.pl < $ALLFILES  > $NMRESULTS 2> /dev/null
-else
-xargs -n 1 nm --format=bsd --size-sort --print-file-name --demangle < $ALLFILES > $NMRESULTS 2> /dev/null
-fi
-
-
-#
-#   Produce the TSV output.
-#
-
-$OBJROOT/dist/bin/nm2tsv --input $NMRESULTS > $RAWTSVFILE
-
-fi  # USE_READELF
-
-#
-#   Sort the TSV output for useful diffing and eyeballing in general.
-#
-sort -r $RAWTSVFILE > $COPYSORTTSV
-
-
-#
-#   If a historical file was specified, diff it with our sorted tsv values.
-#   Run it through a tool to summaries the diffs to the module
-#       level report.
-#   Otherwise, generate the module level report from our new data.
-#
-
-rm -f $SUMMARYFILE
-DIFFFILE="$MYTMPDIR/diff.txt"
-if [ -e $OLDTSVFILE ]; then
-  diff $OLDTSVFILE $COPYSORTTSV > $DIFFFILE
-  $OBJROOT/dist/bin/maptsvdifftool $ZERODRIFT --input $DIFFFILE >> $SUMMARYFILE
-else
-  $OBJROOT/dist/bin/codesighs --modules --input $COPYSORTTSV >> $SUMMARYFILE
-fi
-
-
-#
-#   Output our numbers, that will let tinderbox specify everything all
-#       at once.
-#   First number is in fact the total size of all code and data in the map
-#       files parsed.
-#   Second number, if present, is growth/shrinkage.
-#
-
-if [ $TINDERBOX_OUTPUT ]; then
-    echo -n "__codesize:"
-fi
-$OBJROOT/dist/bin/codesighs --totalonly --input $COPYSORTTSV
-
-if [ -e $DIFFFILE ]; then
-if [ $TINDERBOX_OUTPUT ]; then
-    echo -n "__codesizeDiff:"
-fi
-    $OBJROOT/dist/bin/maptsvdifftool $ZERODRIFT --summary --input $DIFFFILE
-fi
-
-#
-#   Remove our temporary directory.
-#
-rm -rf $MYTMPDIR
deleted file mode 100755
--- a/tools/codesighs/autosummary.win.bash
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/bin/bash
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#
-# Check for optional objdir
-# 
-if [ "$1" = "-o" ]; then 
-OBJROOT="$2"
-shift
-shift
-else
-OBJROOT="./mozilla"
-fi
-
-if [ "$1" = "-s" ]; then 
-SRCROOT="$2"
-shift
-shift
-else
-SRCROOT="./mozilla"
-fi
-
-#
-#   A little help for my friends.
-#
-if [ "-h" == "$1" ];then 
-    SHOWHELP="1"
-fi
-if [ "--help" == "$1" ];then 
-    SHOWHELP="1"
-fi
-if [ "" == "$1" ]; then
-    SHOWHELP="1"
-fi
-if [ "" == "$2" ]; then
-    SHOWHELP="1"
-fi
-if [ "" == "$3" ]; then
-    SHOWHELP="1"
-fi
-
-
-#
-#   Show the help if required.
-#
-if [ $SHOWHELP ]; then
-    echo "usage: $0 <save_results> <old_results> <summary>"
-    echo "  <save_results> is a file that will receive the results of this run."
-    echo "    This file can be used in a future run as the old results."
-    echo "  <old_results> is a results file from a previous run."
-    echo "    It is used to diff with current results and come up with a summary"
-    echo "      of changes."
-    echo "    It is OK if the file does not exist, just supply the argument."
-    echo "  <summary> is a file which will contain a human readable report."
-    echo "    This file is most useful by providing more information than the"
-    echo "      normally single digit output of this script."
-    echo ""
-    echo "Run this command from the parent directory of the mozilla tree."
-    echo ""
-    echo "This command will output two numbers to stdout that will represent"
-    echo "  the total size of all code and data, and a delta from the prior."
-    echo "  the old results."
-    echo "For much more detail on size drifts refer to the summary report."
-    echo ""
-    echo "This tool reports on all executables in the directory tree."
-    exit
-fi
-
-
-#
-#   Stash our arguments away.
-#
-COPYSORTTSV="$1"
-OLDTSVFILE="$2"
-SUMMARYFILE="$3"
-
-
-#
-#   Create our temporary directory.
-#
-MYTMPDIR=`mktemp -d ./codesighs.tmp.XXXXXXXX`
-
-
-#
-#   Find the types of files we are interested in.
-#
-ONEFINDPASS="$MYTMPDIR/onefind.list"
-/usr/bin/find $OBJROOT -type f -name "*.obj" -or -name "*.map" | while read FNAME; do
-    cygpath -m $FNAME >> $ONEFINDPASS
-done
-
-
-#
-#   Find all object files.
-#
-ALLOBJSFILE="$MYTMPDIR/allobjs.list"
-grep -i "\.obj$" < $ONEFINDPASS > $ALLOBJSFILE
-
-
-#
-#   Get a dump of the symbols in every object file.
-#
-ALLOBJSYMSFILE="$MYTMPDIR/allobjsyms.list"
-xargs -n 1 dumpbin.exe /symbols < $ALLOBJSFILE > $ALLOBJSYMSFILE 2> /dev/null
-
-
-#
-#   Produce the symdb for the symbols in all object files.
-#
-SYMDBFILE="$MYTMPDIR/symdb.tsv"
-$OBJROOT/dist/bin/msdump2symdb --input $ALLOBJSYMSFILE | /usr/bin/sort > $SYMDBFILE 2> /dev/null
-
-
-#
-#   Find all map files.
-#
-ALLMAPSFILE="$MYTMPDIR/allmaps.list"
-grep -i "\.map$" < $ONEFINDPASS > $ALLMAPSFILE
-
-
-#
-#   Produce the TSV output.
-#
-RAWTSVFILE="$MYTMPDIR/raw.tsv"
-$OBJROOT/dist/bin/msmap2tsv --symdb $SYMDBFILE --batch < $ALLMAPSFILE > $RAWTSVFILE 2> /dev/null
-
-
-#
-#   Sort the TSV output for useful diffing and eyeballing in general.
-#
-/usr/bin/sort -r $RAWTSVFILE > $COPYSORTTSV
-
-
-#
-#   If a historical file was specified, diff it with our sorted tsv values.
-#   Run it through a tool to summaries the diffs to the module
-#       level report.
-#   Otherwise, generate the module level report from our new data.
-#
-rm -f $SUMMARYFILE
-DIFFFILE="$MYTMPDIR/diff.txt"
-if [ -e $OLDTSVFILE ]; then
-  diff $OLDTSVFILE $COPYSORTTSV > $DIFFFILE
-  $OBJROOT/dist/bin/maptsvdifftool --negation --input $DIFFFILE | dos2unix >> $SUMMARYFILE
-else
-  $OBJROOT/dist/bin/codesighs --modules --input $COPYSORTTSV | dos2unix >> $SUMMARYFILE
-fi
-
-
-#
-#   Output our numbers, that will let tinderbox specify everything all
-#       at once.
-#   First number is in fact the total size of all code and data in the map
-#       files parsed.
-#   Second number, if present, is growth/shrinkage.
-#
-
-if [ $TINDERBOX_OUTPUT ]; then
-    echo -n "__codesize:"
-fi
-$OBJROOT/dist/bin/codesighs --totalonly --input $COPYSORTTSV | dos2unix
-
-
-if [ -e $DIFFFILE ]; then
-if [ $TINDERBOX_OUTPUT ]; then
-    echo -n "__codesizeDiff:"
-fi
-    $OBJROOT/dist/bin/maptsvdifftool --negation --summary --input $DIFFFILE | dos2unix
-fi
-
-#
-#   Remove our temporary directory.
-#
-rm -rf $MYTMPDIR
deleted file mode 100644
--- a/tools/codesighs/codesighs.c
+++ /dev/null
@@ -1,1051 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-#include <errno.h>
-
-#define ERROR_REPORT(num, val, msg)   fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg));
-#define CLEANUP(ptr)    do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0)
-
-
-typedef struct __struct_Options
-/*
-**  Options to control how we perform.
-**
-**  mProgramName    Used in help text.
-**  mInput          File to read for input.
-**                  Default is stdin.
-**  mInputName      Name of the file.
-**  mOutput         Output file, append.
-**                  Default is stdout.
-**  mOutputName     Name of the file.
-**  mHelp           Whether or not help should be shown.
-**  mModules        Output module by module information.
-**  mTotalOnly      Only output one number, the total.
-**  mMinSize        Ignore lines below this size.
-**  mMaxSize        Ignore lines above this size.
-**  mMatchScopes    For a line to be processed, it should match.
-**  mMachClasses    For a line to be processed, it should match.
-**  mMatchModules   For a line to be processed, it should match.
-**  mMatchSections  For a line to be processed, it should match.
-**  mMatchObjects   For a line to be processed, it should match.
-**  mMatchSymbols   For a line to be processed, it should match.
-*/
-{
-    const char* mProgramName;
-    FILE* mInput;
-    char* mInputName;
-    FILE* mOutput;
-    char* mOutputName;
-    int mHelp;
-    int mModules;
-    int mTotalOnly;
-    unsigned long mMinSize;
-    unsigned long mMaxSize;
-    char** mMatchScopes;
-    unsigned mMatchScopeCount;
-    char** mMatchClasses;
-    unsigned mMatchClassCount;
-    char** mMatchModules;
-    unsigned mMatchModuleCount;
-    char** mMatchSections;
-    unsigned mMatchSectionCount;
-    char** mMatchObjects;
-    unsigned mMatchObjectCount;
-    char** mMatchSymbols;
-    unsigned mMatchSymbolCount;
-}
-Options;
-
-
-typedef struct __struct_Switch
-/*
-**  Command line options.
-*/
-{
-    const char* mLongName;
-    const char* mShortName;
-    int mHasValue;
-    const char* mValue;
-    const char* mDescription;
-}
-Switch;
-
-#define DESC_NEWLINE "\n\t\t"
-
-static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."};
-static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."};
-static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."};
-static Switch gModuleSwitch = {"--modules", "-m", 0, NULL, "Output individual module numbers as well."};
-static Switch gTotalSwitch = {"--totalonly", "-t", 0, NULL, "Output only one number." DESC_NEWLINE "The total overall size." DESC_NEWLINE "Overrides other output options."};
-static Switch gMinSize = {"--min-size", "-min", 1, NULL, "Only consider symbols equal to or greater than this size." DESC_NEWLINE "The default is 0x00000000."};
-static Switch gMaxSize = {"--max-size", "-max", 1, NULL, "Only consider symbols equal to or smaller than this size." DESC_NEWLINE "The default is 0xFFFFFFFF."};
-static Switch gMatchScope = {"--match-scope", "-msco", 1, NULL, "Only consider scopes that have a substring match." DESC_NEWLINE "Multiple uses allowed to specify a range of scopes," DESC_NEWLINE "though PUBLIC, STATIC, and UNDEF are your only choices."};
-static Switch gMatchClass = {"--match-class", "-mcla", 1, NULL, "Only consider classes that have a substring match." DESC_NEWLINE "Multiple uses allowed to specify a range of classes," DESC_NEWLINE "though CODE and DATA are your only choices."};
-static Switch gMatchModule = {"--match-module", "-mmod", 1, NULL, "Only consider modules that have a substring match." DESC_NEWLINE "Multiple uses allowed to specify an array of modules."};
-static Switch gMatchSection = {"--match-section", "-msec", 1, NULL, "Only consider sections that have a substring match." DESC_NEWLINE "Multiple uses allowed to specify an array of sections."  DESC_NEWLINE "Section is considered symbol type."};
-static Switch gMatchObject = {"--match-object", "-mobj", 1, NULL, "Only consider objects that have a substring match." DESC_NEWLINE "Multiple uses allowed to specify an array of objects."};
-static Switch gMatchSymbol = {"--match-symbol", "-msym", 1, NULL, "Only consider symbols that have a substring match." DESC_NEWLINE "Multiple uses allowed to specify an array of symbols."};
-
-static Switch* gSwitches[] = {
-        &gInputSwitch,
-        &gOutputSwitch,
-        &gModuleSwitch,
-        &gTotalSwitch,
-        &gMinSize,
-        &gMaxSize,
-        &gMatchClass,
-        &gMatchScope,
-        &gMatchModule,
-        &gMatchSection,
-        &gMatchObject,
-        &gMatchSymbol,
-        &gHelpSwitch
-};
-
-
-typedef struct __struct_SizeStats
-/*
-**  Track totals.
-**
-**  mData       Size of data.
-**  mCode       Size of code.
-*/
-{
-    unsigned long mData;
-    unsigned long mCode;
-}
-SizeStats;
-
-
-typedef struct __struct_ModuleStats
-/*
-**  Track module level information.
-**
-**  mModule     Module name.
-**  mSize       Size of module.
-*/
-{
-    char* mModule;
-    SizeStats mSize;
-}
-ModuleStats;
-
-typedef enum __enum_SegmentClass
-{
-        CODE,
-        DATA
-}
-SegmentClass;
-
-
-static int moduleCompare(const void* in1, const void* in2)
-/*
-**  qsort helper function.
-*/
-{
-    int retval = 0;
-
-    const ModuleStats* one = (const ModuleStats*)in1;
-    const ModuleStats* two = (const ModuleStats*)in2;
-    unsigned long oneSize = one->mSize.mCode + one->mSize.mData;
-    unsigned long twoSize = two->mSize.mCode + two->mSize.mData;
-
-    if(oneSize < twoSize)
-    {
-        retval = 1;
-    }
-    else if(oneSize > twoSize)
-    {
-        retval = -1;
-    }
-
-    return retval;
-}
-
-
-void trimWhite(char* inString)
-/*
-**  Remove any whitespace from the end of the string.
-*/
-{
-    int len = strlen(inString);
-
-    while(len)
-    {
-        len--;
-
-        if(isspace(*(inString + len)))
-        {
-            *(inString + len) = '\0';
-        }
-        else
-        {
-            break;
-        }
-    }
-}
-
-int codesighs(Options* inOptions)
-/*
-**  Output a simplistic report based on our options.
-*/
-{
-    int retval = 0;
-    char lineBuffer[0x1000];
-    int scanRes = 0;
-    unsigned long size;
-    #define SEGCLASS_CHARS 15
-    char segClass[SEGCLASS_CHARS + 1];
-    #define SCOPE_CHARS 15
-    char scope[SCOPE_CHARS + 1];
-    #define MODULE_CHARS 255
-    char module[MODULE_CHARS + 1];
-    #define SEGMENT_CHARS 63
-    char segment[SEGMENT_CHARS + 1];
-    #define OBJECT_CHARS 255
-    char object[OBJECT_CHARS + 1];
-    char* symbol;
-    SizeStats overall;
-    ModuleStats* modules = NULL;
-    unsigned moduleCount = 0;
-
-    memset(&overall, 0, sizeof(overall));
-
-    /*
-    **  Read the file line by line, regardless of number of fields.
-    **  We assume tab separated value formatting, at least 7 lead values:
-    **      size class scope module segment object symbol ....
-    */
-    while(0 == retval && NULL != fgets(lineBuffer, sizeof(lineBuffer), inOptions->mInput))
-    {
-        trimWhite(lineBuffer);
-
-#define STRINGIFY(s_) STRINGIFY2(s_)
-#define STRINGIFY2(s_) #s_
-
-        scanRes = sscanf(lineBuffer,
-            "%x\t%" STRINGIFY(SEGCLASS_CHARS) "s\t%"
-            STRINGIFY(SCOPE_CHARS) "s\t%" STRINGIFY(MODULE_CHARS)
-            "s\t%" STRINGIFY(SEGMENT_CHARS) "s\t%"
-            STRINGIFY(OBJECT_CHARS) "s\t",
-            (unsigned*)&size,
-            segClass,
-            scope,
-            module,
-            segment,
-            object);
-
-        if(6 == scanRes)
-        {
-            SegmentClass segmentClass = CODE;
-
-            symbol = strchr(lineBuffer, '\t') + 1;
-
-            /*
-            **  Qualify the segment class.
-            */
-            if(0 == strcmp(segClass, "DATA"))
-            {
-                segmentClass = DATA;
-            }
-            else if(0 == strcmp(segClass, "CODE"))
-            {
-                segmentClass = CODE;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, segClass, "Unable to determine segment class.");
-            }
-
-            if(0 == retval)
-            {
-                /*
-                **  Match any options required before continuing.
-                **  This is where you would want to add more restrictive totalling.
-                */
-
-                /*
-                **  Match size.
-                */
-                if(size < inOptions->mMinSize)
-                {
-                    continue;
-                }
-                if(size > inOptions->mMaxSize)
-                {
-                    continue;
-                }
-
-                /*
-                **  Match class.
-                */
-                if(0 != inOptions->mMatchClassCount)
-                {
-                    unsigned loop = 0;
-
-                    for(loop = 0; loop < inOptions->mMatchClassCount; loop++)
-                    {
-                        if(NULL != strstr(segClass, inOptions->mMatchClasses[loop]))
-                        {
-                            break;
-                        }
-                    }
-
-                    /*
-                    **  If there was no match, we skip the line.
-                    */
-                    if(loop == inOptions->mMatchClassCount)
-                    {
-                        continue;
-                    }
-                }
-
-                /*
-                **  Match scope.
-                */
-                if(0 != inOptions->mMatchScopeCount)
-                {
-                    unsigned loop = 0;
-
-                    for(loop = 0; loop < inOptions->mMatchScopeCount; loop++)
-                    {
-                        if(NULL != strstr(scope, inOptions->mMatchScopes[loop]))
-                        {
-                            break;
-                        }
-                    }
-
-                    /*
-                    **  If there was no match, we skip the line.
-                    */
-                    if(loop == inOptions->mMatchScopeCount)
-                    {
-                        continue;
-                    }
-                }
-
-                /*
-                **  Match modules.
-                */
-                if(0 != inOptions->mMatchModuleCount)
-                {
-                    unsigned loop = 0;
-
-                    for(loop = 0; loop < inOptions->mMatchModuleCount; loop++)
-                    {
-                        if(NULL != strstr(module, inOptions->mMatchModules[loop]))
-                        {
-                            break;
-                        }
-                    }
-
-                    /*
-                    **  If there was no match, we skip the line.
-                    */
-                    if(loop == inOptions->mMatchModuleCount)
-                    {
-                        continue;
-                    }
-                }
-
-                /*
-                **  Match sections.
-                */
-                if(0 != inOptions->mMatchSectionCount)
-                {
-                    unsigned loop = 0;
-
-                    for(loop = 0; loop < inOptions->mMatchSectionCount; loop++)
-                    {
-                        if(NULL != strstr(segment, inOptions->mMatchSections[loop]))
-                        {
-                            break;
-                        }
-                    }
-
-                    /*
-                    **  If there was no match, we skip the line.
-                    */
-                    if(loop == inOptions->mMatchSectionCount)
-                    {
-                        continue;
-                    }
-                }
-
-                /*
-                **  Match object.
-                */
-                if(0 != inOptions->mMatchObjectCount)
-                {
-                    unsigned loop = 0;
-
-                    for(loop = 0; loop < inOptions->mMatchObjectCount; loop++)
-                    {
-                        if(NULL != strstr(object, inOptions->mMatchObjects[loop]))
-                        {
-                            break;
-                        }
-                    }
-
-                    /*
-                    **  If there was no match, we skip the line.
-                    */
-                    if(loop == inOptions->mMatchObjectCount)
-                    {
-                        continue;
-                    }
-                }
-
-                /*
-                **  Match symbols.
-                */
-                if(0 != inOptions->mMatchSymbolCount)
-                {
-                    unsigned loop = 0;
-
-                    for(loop = 0; loop < inOptions->mMatchSymbolCount; loop++)
-                    {
-                        if(NULL != strstr(symbol, inOptions->mMatchSymbols[loop]))
-                        {
-                            break;
-                        }
-                    }
-
-                    /*
-                    **  If there was no match, we skip the line.
-                    */
-                    if(loop == inOptions->mMatchSymbolCount)
-                    {
-                        continue;
-                    }
-                }
-
-                /*
-                **  Update overall totals.
-                */
-                if(CODE == segmentClass)
-                {
-                    overall.mCode += size;
-                }
-                else if(DATA == segmentClass)
-                {
-                    overall.mData += size;
-                }
-
-                /*
-                **  See what else we should be tracking.
-                */
-                if(0 == inOptions->mTotalOnly)
-                {
-                    if(inOptions->mModules)
-                    {
-                        unsigned index = 0;
-                        
-                        /*
-                        **  Find the module to modify.
-                        */
-                        for(index = 0; index < moduleCount; index++)
-                        {
-                            if(0 == strcmp(modules[index].mModule, module))
-                            {
-                                break;
-                            }
-                        }
-                        
-                        /*
-                        **  If the index is the same as the count, we need to
-                        **      add a new module.
-                        */
-                        if(index == moduleCount)
-                        {
-                            void* moved = NULL;
-                            
-                            moved = realloc(modules, sizeof(ModuleStats) * (moduleCount + 1));
-                            if(NULL != moved)
-                            {
-                                modules = (ModuleStats*)moved;
-                                moduleCount++;
-                                
-                                memset(modules + index, 0, sizeof(ModuleStats));
-                                modules[index].mModule = strdup(module);
-                                if(NULL == modules[index].mModule)
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, module, "Unable to duplicate string.");
-                                }
-                            }
-                            else
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, inOptions->mProgramName, "Unable to allocate module memory.");
-                            }
-                        }
-                        
-                        if(0 == retval)
-                        {
-                            if(CODE == segmentClass)
-                            {
-                                modules[index].mSize.mCode += size;
-                            }
-                            else if(DATA == segmentClass)
-                            {
-                                modules[index].mSize.mData += size;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, inOptions->mInputName, "Problem extracting values from file.");
-        }
-    }
-
-    if(0 == retval && 0 != ferror(inOptions->mInput))
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, inOptions->mInputName, "Unable to read file.");
-    }
-
-    /*
-    **  If all went well, time to report.
-    */
-    if(0 == retval)
-    {
-        if(inOptions->mTotalOnly)
-        {
-            fprintf(inOptions->mOutput, "%u\n", (unsigned)(overall.mCode + overall.mData));
-        }
-        else
-        {
-            fprintf(inOptions->mOutput, "Overall Size\n");
-            fprintf(inOptions->mOutput, "\tTotal:\t%10u\n", (unsigned)(overall.mCode + overall.mData));
-            fprintf(inOptions->mOutput, "\tCode:\t%10u\n", (unsigned)overall.mCode);
-            fprintf(inOptions->mOutput, "\tData:\t%10u\n", (unsigned)overall.mData);
-        }
-
-        /*
-        **  Check options to see what else we should output.
-        */
-        if(inOptions->mModules && moduleCount)
-        {
-            unsigned loop = 0;
-
-            /*
-            **  Sort the modules by their size.
-            */
-            qsort(modules, (size_t)moduleCount, sizeof(ModuleStats), moduleCompare);
-
-            /*
-            **  Output each one.
-            **  Might as well clean up while we go too.
-            */
-            for(loop = 0; loop < moduleCount; loop++)
-            {
-                fprintf(inOptions->mOutput, "\n");
-                fprintf(inOptions->mOutput, "%s\n", modules[loop].mModule);
-                fprintf(inOptions->mOutput, "\tTotal:\t%10u\n", (unsigned)(modules[loop].mSize.mCode + modules[loop].mSize.mData));
-                fprintf(inOptions->mOutput, "\tCode:\t%10u\n", (unsigned)modules[loop].mSize.mCode);
-                fprintf(inOptions->mOutput, "\tData:\t%10u\n", (unsigned)modules[loop].mSize.mData);
-
-                CLEANUP(modules[loop].mModule);
-            }
-
-            /*
-            **  Done with modules.
-            */
-            CLEANUP(modules);
-            moduleCount = 0;
-        }
-    }
-
-    return retval;
-}
-
-
-int initOptions(Options* outOptions, int inArgc, char** inArgv)
-/*
-**  returns int     0 if successful.
-*/
-{
-    int retval = 0;
-    int loop = 0;
-    int switchLoop = 0;
-    int match = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    Switch* current = NULL;
-
-    /*
-    **  Set any defaults.
-    */
-    memset(outOptions, 0, sizeof(Options));
-    outOptions->mProgramName = inArgv[0];
-    outOptions->mInput = stdin;
-    outOptions->mInputName = strdup("stdin");
-    outOptions->mOutput = stdout;
-    outOptions->mOutputName = strdup("stdout");
-    outOptions->mMaxSize = 0xFFFFFFFFU;
-
-    if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName)
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup.");
-    }
-
-    /*
-    **  Go through and attempt to do the right thing.
-    */
-    for(loop = 1; loop < inArgc && 0 == retval; loop++)
-    {
-        match = 0;
-        current = NULL;
-
-        for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++)
-        {
-            if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-            else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-
-            if(match)
-            {
-                if(gSwitches[switchLoop]->mHasValue)
-                {
-                    /*
-                    **  Attempt to absorb next option to fullfill value.
-                    */
-                    if(loop + 1 < inArgc)
-                    {
-                        loop++;
-
-                        current = gSwitches[switchLoop];
-                        current->mValue = inArgv[loop];
-                    }
-                }
-                else
-                {
-                    current = gSwitches[switchLoop];
-                }
-
-                break;
-            }
-        }
-
-        if(0 == match)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch.");
-        }
-        else if(NULL == current)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value.");
-        }
-        else
-        {
-            /*
-            ** Do something based on address/swtich.
-            */
-            if(current == &gInputSwitch)
-            {
-                CLEANUP(outOptions->mInputName);
-                if(NULL != outOptions->mInput && stdin != outOptions->mInput)
-                {
-                    fclose(outOptions->mInput);
-                    outOptions->mInput = NULL;
-                }
-
-                outOptions->mInput = fopen(current->mValue, "r");
-                if(NULL == outOptions->mInput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open input file.");
-                }
-                else
-                {
-                    outOptions->mInputName = strdup(current->mValue);
-                    if(NULL == outOptions->mInputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gOutputSwitch)
-            {
-                CLEANUP(outOptions->mOutputName);
-                if(NULL != outOptions->mOutput && stdout != outOptions->mOutput)
-                {
-                    fclose(outOptions->mOutput);
-                    outOptions->mOutput = NULL;
-                }
-
-                outOptions->mOutput = fopen(current->mValue, "a");
-                if(NULL == outOptions->mOutput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open output file.");
-                }
-                else
-                {
-                    outOptions->mOutputName = strdup(current->mValue);
-                    if(NULL == outOptions->mOutputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gHelpSwitch)
-            {
-                outOptions->mHelp = __LINE__;
-            }
-            else if(current == &gModuleSwitch)
-            {
-                outOptions->mModules = __LINE__;
-            }
-            else if(current == &gTotalSwitch)
-            {
-                outOptions->mTotalOnly = __LINE__;
-            }
-            else if(current == &gMinSize)
-            {
-                unsigned long arg = 0;
-                char* endScan = NULL;
-
-                errno = 0;
-                arg = strtoul(current->mValue, &endScan, 0);
-                if(0 == errno && endScan != current->mValue)
-                {
-                    outOptions->mMinSize = arg;
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to convert to a number.");
-                }
-            }
-            else if(current == &gMaxSize)
-            {
-                unsigned long arg = 0;
-                char* endScan = NULL;
-
-                errno = 0;
-                arg = strtoul(current->mValue, &endScan, 0);
-                if(0 == errno && endScan != current->mValue)
-                {
-                    outOptions->mMaxSize = arg;
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to convert to a number.");
-                }
-            }
-            else if(current == &gMatchClass)
-            {
-                char* dupMatch = NULL;
-                
-                dupMatch = strdup(current->mValue);
-                if(NULL != dupMatch)
-                {
-                    void* moved = NULL;
-
-                    moved = realloc(outOptions->mMatchClasses, sizeof(char*) * (outOptions->mMatchClassCount + 1));
-                    if(NULL != moved)
-                    {
-                        outOptions->mMatchClasses = (char**)moved;
-                        outOptions->mMatchClasses[outOptions->mMatchClassCount] = dupMatch;
-                        outOptions->mMatchClassCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mLongName, "Unable to expand array.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                }
-            }
-            else if(current == &gMatchScope)
-            {
-                char* dupMatch = NULL;
-                
-                dupMatch = strdup(current->mValue);
-                if(NULL != dupMatch)
-                {
-                    void* moved = NULL;
-
-                    moved = realloc(outOptions->mMatchScopes, sizeof(char*) * (outOptions->mMatchScopeCount + 1));
-                    if(NULL != moved)
-                    {
-                        outOptions->mMatchScopes = (char**)moved;
-                        outOptions->mMatchScopes[outOptions->mMatchScopeCount] = dupMatch;
-                        outOptions->mMatchScopeCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mLongName, "Unable to expand array.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                }
-            }
-            else if(current == &gMatchModule)
-            {
-                char* dupMatch = NULL;
-                
-                dupMatch = strdup(current->mValue);
-                if(NULL != dupMatch)
-                {
-                    void* moved = NULL;
-
-                    moved = realloc(outOptions->mMatchModules, sizeof(char*) * (outOptions->mMatchModuleCount + 1));
-                    if(NULL != moved)
-                    {
-                        outOptions->mMatchModules = (char**)moved;
-                        outOptions->mMatchModules[outOptions->mMatchModuleCount] = dupMatch;
-                        outOptions->mMatchModuleCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mLongName, "Unable to expand array.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                }
-            }
-            else if(current == &gMatchSection)
-            {
-                char* dupMatch = NULL;
-                
-                dupMatch = strdup(current->mValue);
-                if(NULL != dupMatch)
-                {
-                    void* moved = NULL;
-
-                    moved = realloc(outOptions->mMatchSections, sizeof(char*) * (outOptions->mMatchSectionCount + 1));
-                    if(NULL != moved)
-                    {
-                        outOptions->mMatchSections = (char**)moved;
-                        outOptions->mMatchSections[outOptions->mMatchSectionCount] = dupMatch;
-                        outOptions->mMatchSectionCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mLongName, "Unable to expand array.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                }
-            }
-            else if(current == &gMatchObject)
-            {
-                char* dupMatch = NULL;
-                
-                dupMatch = strdup(current->mValue);
-                if(NULL != dupMatch)
-                {
-                    void* moved = NULL;
-
-                    moved = realloc(outOptions->mMatchObjects, sizeof(char*) * (outOptions->mMatchObjectCount + 1));
-                    if(NULL != moved)
-                    {
-                        outOptions->mMatchObjects = (char**)moved;
-                        outOptions->mMatchObjects[outOptions->mMatchObjectCount] = dupMatch;
-                        outOptions->mMatchObjectCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mLongName, "Unable to expand array.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                }
-            }
-            else if(current == &gMatchSymbol)
-            {
-                char* dupMatch = NULL;
-                
-                dupMatch = strdup(current->mValue);
-                if(NULL != dupMatch)
-                {
-                    void* moved = NULL;
-
-                    moved = realloc(outOptions->mMatchSymbols, sizeof(char*) * (outOptions->mMatchSymbolCount + 1));
-                    if(NULL != moved)
-                    {
-                        outOptions->mMatchSymbols = (char**)moved;
-                        outOptions->mMatchSymbols[outOptions->mMatchSymbolCount] = dupMatch;
-                        outOptions->mMatchSymbolCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mLongName, "Unable to expand array.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                }
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, current->mLongName, "No handler for command line switch.");
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-void cleanOptions(Options* inOptions)
-/*
-**  Clean up any open handles.
-*/
-{
-    unsigned loop = 0;
-
-    CLEANUP(inOptions->mInputName);
-    if(NULL != inOptions->mInput && stdin != inOptions->mInput)
-    {
-        fclose(inOptions->mInput);
-    }
-    CLEANUP(inOptions->mOutputName);
-    if(NULL != inOptions->mOutput && stdout != inOptions->mOutput)
-    {
-        fclose(inOptions->mOutput);
-    }
-
-    for(loop = 0; loop < inOptions->mMatchClassCount; loop++)
-    {
-        CLEANUP(inOptions->mMatchClasses[loop]);
-    }
-    CLEANUP(inOptions->mMatchClasses);
-
-    for(loop = 0; loop < inOptions->mMatchScopeCount; loop++)
-    {
-        CLEANUP(inOptions->mMatchScopes[loop]);
-    }
-    CLEANUP(inOptions->mMatchScopes);
-
-    for(loop = 0; loop < inOptions->mMatchModuleCount; loop++)
-    {
-        CLEANUP(inOptions->mMatchModules[loop]);
-    }
-    CLEANUP(inOptions->mMatchModules);
-
-    for(loop = 0; loop < inOptions->mMatchSectionCount; loop++)
-    {
-        CLEANUP(inOptions->mMatchSections[loop]);
-    }
-    CLEANUP(inOptions->mMatchSections);
-
-    for(loop = 0; loop < inOptions->mMatchObjectCount; loop++)
-    {
-        CLEANUP(inOptions->mMatchObjects[loop]);
-    }
-    CLEANUP(inOptions->mMatchObjects);
-
-    for(loop = 0; loop < inOptions->mMatchSymbolCount; loop++)
-    {
-        CLEANUP(inOptions->mMatchSymbols[loop]);
-    }
-    CLEANUP(inOptions->mMatchSymbols);
-
-    memset(inOptions, 0, sizeof(Options));
-}
-
-
-void showHelp(Options* inOptions)
-/*
-**  Show some simple help text on usage.
-*/
-{
-    int loop = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    const char* valueText = NULL;
-
-    printf("usage:\t%s [arguments]\n", inOptions->mProgramName);
-    printf("\n");
-    printf("arguments:\n");
-
-    for(loop = 0; loop < switchCount; loop++)
-    {
-        if(gSwitches[loop]->mHasValue)
-        {
-            valueText = " <value>";
-        }
-        else
-        {
-            valueText = "";
-        }
-
-        printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText);
-        printf("\t %s%s", gSwitches[loop]->mShortName, valueText);
-        printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription);
-    }
-
-    printf("This tool takes a tsv file and reports composite code and data sizes.\n");
-}
-
-
-int main(int inArgc, char** inArgv)
-{
-    int retval = 0;
-    Options options;
-
-    retval = initOptions(&options, inArgc, inArgv);
-    if(options.mHelp)
-    {
-        showHelp(&options);
-    }
-    else if(0 == retval)
-    {
-        retval = codesighs(&options);
-    }
-
-    cleanOptions(&options);
-    return retval;
-}
-
deleted file mode 100755
--- a/tools/codesighs/codesighs.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2011 Mozilla Foundation. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#   1. Redistributions of source code must retain the above copyright
-#      notice, this list of conditions and the following disclaimer.
-#
-#   2. 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.
-#
-# THIS SOFTWARE IS PROVIDED BY THE MOZILLA FOUNDATION ``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 MOZILLA FOUNDATION 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.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Mozilla
-# Foundation.
-
-import sys, os
-
-def sumDirectorySize(path):
-    """
-    Calculate the total size of all the files under |path|.
-    """
-    total = 0
-    def reraise(e):
-        raise e
-    for root, dirs, files in os.walk(path, onerror=reraise):
-        for f in files:
-            total += os.path.getsize(os.path.join(root, f))
-    return total
-
-def codesighs(stagepath, installerpath):
-    """
-    Calculate the total size of the files under |stagepath| on disk
-    and print it as "__codesize", and print the size of the file at
-    |installerpath| as "__installersize".
-    """
-    try:
-        print "__codesize:%d" % sumDirectorySize(stagepath)
-        print "__installersize:%d" % os.path.getsize(installerpath)
-    except OSError, e:
-        print >>sys.stderr, """Couldn't read file %s.
-Perhaps you need to run |make package| or |make installer|?""" % e.filename
-
-if __name__ == '__main__':
-    if len(sys.argv) < 3:
-        print >>sys.stderr, "Usage: codesighs.py <package stage path> <installer path>"
-        sys.exit(1)
-    codesighs(sys.argv[1], sys.argv[2])
deleted file mode 100644
--- a/tools/codesighs/maptsvdifftool.c
+++ /dev/null
@@ -1,1289 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#define ERROR_REPORT(num, val, msg)   fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg));
-#define CLEANUP(ptr)    do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0)
-
-
-typedef struct __struct_Options
-/*
-**  Options to control how we perform.
-**
-**  mProgramName    Used in help text.
-**  mInput          File to read for input.
-**                  Default is stdin.
-**  mInputName      Name of the file.
-**  mOutput         Output file, append.
-**                  Default is stdout.
-**  mOutputName     Name of the file.
-**  mHelp           Whether or not help should be shown.
-**  mSummaryOnly    Only output a signle line.
-**  mZeroDrift      Output zero drift data.
-**  mNegation       Perform negation heuristics on the symbol drifts.
-*/
-{
-    const char* mProgramName;
-    FILE* mInput;
-    char* mInputName;
-    FILE* mOutput;
-    char* mOutputName;
-    int mHelp;
-    int mSummaryOnly;
-    int mZeroDrift;
-    int mNegation;
-}
-Options;
-
-
-typedef struct __struct_Switch
-/*
-**  Command line options.
-*/
-{
-    const char* mLongName;
-    const char* mShortName;
-    int mHasValue;
-    const char* mValue;
-    const char* mDescription;
-}
-Switch;
-
-#define DESC_NEWLINE "\n\t\t"
-
-static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."};
-static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."};
-static Switch gSummarySwitch = {"--summary", "-s", 0, NULL, "Only output a single line." DESC_NEWLINE "The cumulative size changes." DESC_NEWLINE "Overrides all other output options."};
-static Switch gZeroDriftSwitch = {"--zerodrift", "-z", 0, NULL, "Output zero drift data." DESC_NEWLINE "Reports symbol changes even when there is no net drift."};
-static Switch gNegationSwitch = {"--negation", "-n", 0, NULL, "Use negation heuristics." DESC_NEWLINE "When symbol sizes are inferred by offset, order changes cause noise." DESC_NEWLINE "This helps see through the noise by eliminating equal and opposite drifts."};
-static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."};
-
-static Switch* gSwitches[] = {
-        &gInputSwitch,
-        &gOutputSwitch,
-        &gSummarySwitch,
-        &gZeroDriftSwitch,
-        &gNegationSwitch,
-        &gHelpSwitch
-};
-
-
-typedef struct __struct_SizeComposition
-/*
-**  Used to keep which parts positive and negative resulted in the total.
-*/
-{
-    int mPositive;
-    int mNegative;
-}
-SizeComposition;
-
-
-typedef struct __struct_SizeStats
-/*
-**  Keep track of sizes.
-**  Use signed integers so that negatives are valid, in which case we shrunk.
-*/
-{
-    int mCode;
-    SizeComposition mCodeComposition;
-
-    int mData;
-    SizeComposition mDataComposition;
-}
-SizeStats;
-
-
-typedef enum __enum_SegmentClass
-/*
-**  What type of data a segment holds.
-*/
-{
-        CODE,
-        DATA
-}
-SegmentClass;
-
-
-typedef struct __struct_SymbolStats
-/*
-**  Symbol level stats.
-*/
-{
-    char* mSymbol;
-    int mSize;
-}
-SymbolStats;
-
-
-typedef struct __struct_ObjectStats
-/*
-**  Object level stats.
-*/
-{
-    char* mObject;
-    int mSize;
-    SizeComposition mComposition;
-    SymbolStats* mSymbols;
-    unsigned mSymbolCount;
-}
-ObjectStats;
-
-
-typedef struct __struct_SegmentStats
-/*
-**  Segment level stats.
-*/
-{
-    char* mSegment;
-    SegmentClass mClass;
-    int mSize;
-    SizeComposition mComposition;
-    ObjectStats* mObjects;
-    unsigned mObjectCount;
-}
-SegmentStats;
-
-
-typedef struct __struct_ModuleStats
-/*
-**  Module level stats.
-*/
-{
-    char* mModule;
-    SizeStats mSize;
-    SegmentStats* mSegments;
-    unsigned mSegmentCount;
-}
-ModuleStats;
-
-
-static int moduleCompare(const void* in1, const void* in2)
-/*
-**  qsort helper.
-*/
-{
-    int retval = 0;
-
-    ModuleStats* one = (ModuleStats*)in1;
-    ModuleStats* two = (ModuleStats*)in2;
-
-    int oneSize = (one->mSize.mCode + one->mSize.mData);
-    int twoSize = (two->mSize.mCode + two->mSize.mData);
-
-    if(oneSize < twoSize)
-    {
-        retval = 1;
-    }
-    else if(oneSize > twoSize)
-    {
-        retval = -1;
-    }
-    else
-    {
-        retval = strcmp(one->mModule, two->mModule);
-        if(0 > oneSize && 0 > twoSize)
-        {
-            retval *= -1;
-        }
-    }
-
-    return retval;
-}
-
-
-static int segmentCompare(const void* in1, const void* in2)
-/*
-**  qsort helper.
-*/
-{
-    int retval = 0;
-
-    SegmentStats* one = (SegmentStats*)in1;
-    SegmentStats* two = (SegmentStats*)in2;
-
-    if(one->mSize < two->mSize)
-    {
-        retval = 1;
-    }
-    else if(one->mSize > two->mSize)
-    {
-        retval = -1;
-    }
-    else
-    {
-        retval = strcmp(one->mSegment, two->mSegment);
-        if(0 > one->mSize && 0 > two->mSize)
-        {
-            retval *= -1;
-        }
-    }
-
-    return retval;
-}
-
-
-static int objectCompare(const void* in1, const void* in2)
-/*
-**  qsort helper.
-*/
-{
-    int retval = 0;
-
-    ObjectStats* one = (ObjectStats*)in1;
-    ObjectStats* two = (ObjectStats*)in2;
-
-    if(one->mSize < two->mSize)
-    {
-        retval = 1;
-    }
-    else if(one->mSize > two->mSize)
-    {
-        retval = -1;
-    }
-    else
-    {
-        retval = strcmp(one->mObject, two->mObject);
-        if(0 > one->mSize && 0 > two->mSize)
-        {
-            retval *= -1;
-        }
-    }
-
-    return retval;
-}
-
-
-static int symbolCompare(const void* in1, const void* in2)
-/*
-**  qsort helper.
-*/
-{
-    int retval = 0;
-
-    SymbolStats* one = (SymbolStats*)in1;
-    SymbolStats* two = (SymbolStats*)in2;
-
-    if(one->mSize < two->mSize)
-    {
-        retval = 1;
-    }
-    else if(one->mSize > two->mSize)
-    {
-        retval = -1;
-    }
-    else
-    {
-        retval = strcmp(one->mSymbol, two->mSymbol);
-        if(0 > one->mSize && 0 > two->mSize)
-        {
-            retval *= -1;
-        }
-    }
-
-    return retval;
-}
-
-
-void trimWhite(char* inString)
-/*
-**  Remove any whitespace from the end of the string.
-*/
-{
-    int len = strlen(inString);
-
-    while(len)
-    {
-        len--;
-
-        if(isspace(*(inString + len)))
-        {
-            *(inString + len) = '\0';
-        }
-        else
-        {
-            break;
-        }
-    }
-}
-
-
-int difftool(Options* inOptions)
-/*
-**  Read a diff file and spit out relevant information.
-*/
-{
-    int retval = 0;
-    char lineBuffer[0x500];
-    SizeStats overall;
-    ModuleStats* modules = NULL;
-    unsigned moduleCount = 0;
-    unsigned moduleLoop = 0;
-    ModuleStats* theModule = NULL;
-    unsigned segmentLoop = 0;
-    SegmentStats* theSegment = NULL;
-    unsigned objectLoop = 0;
-    ObjectStats* theObject = NULL;
-    unsigned symbolLoop = 0;
-    SymbolStats* theSymbol = NULL;
-    unsigned allSymbolCount = 0;
-
-    memset(&overall, 0, sizeof(overall));
-
-    /*
-    **  Read the entire diff file.
-    **  We're only interested in lines beginning with < or >
-    */
-    while(0 == retval && NULL != fgets(lineBuffer, sizeof(lineBuffer), inOptions->mInput))
-    {
-        trimWhite(lineBuffer);
-
-        if(('<' == lineBuffer[0] || '>' == lineBuffer[0]) && ' ' == lineBuffer[1])
-        {
-            int additive = 0;
-            char* theLine = &lineBuffer[2];
-            int scanRes = 0;
-            int size;
-            #define SEGCLASS_CHARS 15
-            char segClass[SEGCLASS_CHARS + 1];
-            #define SCOPE_CHARS 15
-            char scope[SCOPE_CHARS + 1];
-            #define MODULE_CHARS 255
-            char module[MODULE_CHARS + 1];
-            #define SEGMENT_CHARS 63
-            char segment[SEGMENT_CHARS + 1];
-            #define OBJECT_CHARS 255
-            char object[OBJECT_CHARS + 1];
-            char* symbol = NULL;
-
-            /*
-            **  Figure out if the line adds or subtracts from something.
-            */
-            if('>' == lineBuffer[0])
-            {
-                additive = __LINE__;
-            }
-
-
-            /*
-            **  Scan the line for information.
-            */
-
-#define STRINGIFY(s_) STRINGIFY2(s_)
-#define STRINGIFY2(s_) #s_
-
-            scanRes = sscanf(theLine,
-                "%x\t%" STRINGIFY(SEGCLASS_CHARS) "s\t%"
-                STRINGIFY(SCOPE_CHARS) "s\t%" STRINGIFY(MODULE_CHARS)
-                "s\t%" STRINGIFY(SEGMENT_CHARS) "s\t%"
-                STRINGIFY(OBJECT_CHARS) "s\t",
-                (unsigned*)&size,
-                segClass,
-                scope,
-                module,
-                segment,
-                object);
-
-            if(6 == scanRes)
-            {
-                SegmentClass segmentClass = DATA;
-
-                symbol = strrchr(theLine, '\t') + 1;
-
-                if(0 == strcmp(segClass, "CODE"))
-                {
-                    segmentClass = CODE;
-                }
-                else if(0 == strcmp(segClass, "DATA"))
-                {
-                    segmentClass = DATA;
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, segClass, "Unable to determine segment class.");
-                }
-
-                if(0 == retval)
-                {
-                    unsigned moduleIndex = 0;
-
-                    /*
-                    **  Find, in succession, the following things:
-                    **      the module
-                    **      the segment
-                    **      the object
-                    **      the symbol
-                    **  Failure to find any one of these means to create it.
-                    */
-                    
-                    for(moduleIndex = 0; moduleIndex < moduleCount; moduleIndex++)
-                    {
-                        if(0 == strcmp(modules[moduleIndex].mModule, module))
-                        {
-                            break;
-                        }
-                    }
-                    
-                    if(moduleIndex == moduleCount)
-                    {
-                        void* moved = NULL;
-                        
-                        moved = realloc(modules, sizeof(ModuleStats) * (1 + moduleCount));
-                        if(NULL != moved)
-                        {
-                            modules = (ModuleStats*)moved;
-                            moduleCount++;
-                            memset(modules + moduleIndex, 0, sizeof(ModuleStats));
-                            
-                            modules[moduleIndex].mModule = strdup(module);
-                            if(NULL == modules[moduleIndex].mModule)
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, module, "Unable to duplicate string.");
-                            }
-                        }
-                        else
-                        {
-                            retval = __LINE__;
-                            ERROR_REPORT(retval, inOptions->mProgramName, "Unable to increase module array.");
-                        }
-                    }
-                    
-                    if(0 == retval)
-                    {
-                        unsigned segmentIndex = 0;
-                        theModule = (modules + moduleIndex);
-                        
-                        for(segmentIndex = 0; segmentIndex < theModule->mSegmentCount; segmentIndex++)
-                        {
-                            if(0 == strcmp(segment, theModule->mSegments[segmentIndex].mSegment))
-                            {
-                                break;
-                            }
-                        }
-                        
-                        if(segmentIndex == theModule->mSegmentCount)
-                        {
-                            void* moved = NULL;
-                            
-                            moved = realloc(theModule->mSegments, sizeof(SegmentStats) * (theModule->mSegmentCount + 1));
-                            if(NULL != moved)
-                            {
-                                theModule->mSegments = (SegmentStats*)moved;
-                                theModule->mSegmentCount++;
-                                memset(theModule->mSegments + segmentIndex, 0, sizeof(SegmentStats));
-                                
-                                theModule->mSegments[segmentIndex].mClass = segmentClass;
-                                theModule->mSegments[segmentIndex].mSegment = strdup(segment);
-                                if(NULL == theModule->mSegments[segmentIndex].mSegment)
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, segment, "Unable to duplicate string.");
-                                }
-                            }
-                            else
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, inOptions->mProgramName, "Unable to increase segment array.");
-                            }
-                        }
-                        
-                        if(0 == retval)
-                        {
-                            unsigned objectIndex = 0;
-                            theSegment = (theModule->mSegments + segmentIndex);
-                            
-                            for(objectIndex = 0; objectIndex < theSegment->mObjectCount; objectIndex++)
-                            {
-                                if(0 == strcmp(object, theSegment->mObjects[objectIndex].mObject))
-                                {
-                                    break;
-                                }
-                            }
-                            
-                            if(objectIndex == theSegment->mObjectCount)
-                            {
-                                void* moved = NULL;
-                                
-                                moved = realloc(theSegment->mObjects, sizeof(ObjectStats) * (1 + theSegment->mObjectCount));
-                                if(NULL != moved)
-                                {
-                                    theSegment->mObjects = (ObjectStats*)moved;
-                                    theSegment->mObjectCount++;
-                                    memset(theSegment->mObjects + objectIndex, 0, sizeof(ObjectStats));
-                                    
-                                    theSegment->mObjects[objectIndex].mObject = strdup(object);
-                                    if(NULL == theSegment->mObjects[objectIndex].mObject)
-                                    {
-                                        retval = __LINE__;
-                                        ERROR_REPORT(retval, object, "Unable to duplicate string.");
-                                    }
-                                }
-                                else
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, inOptions->mProgramName, "Unable to increase object array.");
-                                }
-                            }
-                            
-                            if(0 == retval)
-                            {
-                                unsigned symbolIndex = 0;
-                                theObject = (theSegment->mObjects + objectIndex);
-                                
-                                for(symbolIndex = 0; symbolIndex < theObject->mSymbolCount; symbolIndex++)
-                                {
-                                    if(0 == strcmp(symbol, theObject->mSymbols[symbolIndex].mSymbol))
-                                    {
-                                        break;
-                                    }
-                                }
-                                
-                                if(symbolIndex == theObject->mSymbolCount)
-                                {
-                                    void* moved = NULL;
-                                    
-                                    moved = realloc(theObject->mSymbols, sizeof(SymbolStats) * (1 + theObject->mSymbolCount));
-                                    if(NULL != moved)
-                                    {
-                                        theObject->mSymbols = (SymbolStats*)moved;
-                                        theObject->mSymbolCount++;
-                                        allSymbolCount++;
-                                        memset(theObject->mSymbols + symbolIndex, 0, sizeof(SymbolStats));
-                                        
-                                        theObject->mSymbols[symbolIndex].mSymbol = strdup(symbol);
-                                        if(NULL == theObject->mSymbols[symbolIndex].mSymbol)
-                                        {
-                                            retval = __LINE__;
-                                            ERROR_REPORT(retval, symbol, "Unable to duplicate string.");
-                                        }
-                                    }
-                                    else
-                                    {
-                                        retval = __LINE__;
-                                        ERROR_REPORT(retval, inOptions->mProgramName, "Unable to increase symbol array.");
-                                    }
-                                }
-                                
-                                if(0 == retval)
-                                {
-                                    theSymbol = (theObject->mSymbols + symbolIndex);
-
-                                    /*
-                                    **  Update our various totals.
-                                    */
-                                    if(additive)
-                                    {
-                                        if(CODE == segmentClass)
-                                        {
-                                            overall.mCode += size;
-                                            theModule->mSize.mCode += size;
-                                        }
-                                        else if(DATA == segmentClass)
-                                        {
-                                            overall.mData += size;
-                                            theModule->mSize.mData += size;
-                                        }
-
-                                        theSegment->mSize += size;
-                                        theObject->mSize += size;
-                                        theSymbol->mSize += size;
-                                    }
-                                    else
-                                    {
-                                        if(CODE == segmentClass)
-                                        {
-                                            overall.mCode -= size;
-                                            theModule->mSize.mCode -= size;
-                                        }
-                                        else if(DATA == segmentClass)
-                                        {
-                                            overall.mData -= size;
-                                            theModule->mSize.mData -= size;
-                                        }
-
-                                        theSegment->mSize -= size;
-                                        theObject->mSize -= size;
-                                        theSymbol->mSize -= size;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, inOptions->mInputName, "Unable to scan line data.");
-            }
-        }
-    }
-
-    if(0 == retval && 0 != ferror(inOptions->mInput))
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, inOptions->mInputName, "Unable to read file.");
-    }
-
-    /*
-    **  Next, it is time to perform revisionist history of sorts.
-    **  If the negation switch is in play, we perfrom the following
-    **      aggressive steps:
-    **
-    **  For each section, find size changes which have an equal and
-    **      opposite change, and set them both to zero.
-    **  However, you can only do this if the number of negating changes
-    **      is even, as if it is odd, then any one of the many could be
-    **      at fault for the actual change.
-    **
-    **  This orginally exists to make the win32 codesighs reports more
-    **      readable/meaningful.
-    */
-    if(0 == retval && 0 != inOptions->mNegation)
-    {
-        ObjectStats** objArray = NULL;
-        SymbolStats** symArray = NULL;
-
-        /*
-        **  Create arrays big enough to hold all symbols.
-        **  As well as an array to keep the owning object at the same index.
-        **  We will keep the object around as we may need to modify the size.
-        */
-        objArray = (ObjectStats**)malloc(allSymbolCount * sizeof(ObjectStats*));
-        symArray = (SymbolStats**)malloc(allSymbolCount * sizeof(SymbolStats*));
-        if(NULL == objArray || NULL == symArray)
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, inOptions->mProgramName, "Unable to allocate negation array memory.");
-        }
-        else
-        {
-            unsigned arrayCount = 0;
-            unsigned arrayLoop = 0;
-
-            /*
-            **  Go through and perform the steps on each section/segment.
-            */
-            for(moduleLoop = 0; moduleLoop < moduleCount; moduleLoop++)
-            {
-                theModule = modules + moduleLoop;
-
-                for(segmentLoop = 0; segmentLoop < theModule->mSegmentCount; segmentLoop++)
-                {
-                    theSegment = theModule->mSegments + segmentLoop;
-
-                    /*
-                    **  Collect all symbols under this section.
-                    **  The symbols are spread out between all the objects,
-                    **      so keep track of both independently at the
-                    **      same index.
-                    */
-                    arrayCount = 0;
-
-                    for(objectLoop = 0; objectLoop < theSegment->mObjectCount; objectLoop++)
-                    {
-                        theObject = theSegment->mObjects + objectLoop;
-
-                        for(symbolLoop = 0; symbolLoop < theObject->mSymbolCount; symbolLoop++)
-                        {
-                            theSymbol = theObject->mSymbols + symbolLoop;
-
-                            objArray[arrayCount] = theObject;
-                            symArray[arrayCount] = theSymbol;
-                            arrayCount++;
-                        }
-                    }
-
-                    /*
-                    **  Now that we have a list of symbols, go through each
-                    **      and see if there is a chance of negation.
-                    */
-                    for(arrayLoop = 0; arrayLoop < arrayCount; arrayLoop++)
-                    {
-                        /*
-                        **  If the item is NULL, it was already negated.
-                        **  Don't do this for items with a zero size.
-                        */
-                        if(NULL != symArray[arrayLoop] && 0 != symArray[arrayLoop]->mSize)
-                        {
-                            unsigned identicalValues = 0;
-                            unsigned oppositeValues = 0;
-                            unsigned lookLoop = 0;
-                            const int lookingFor = symArray[arrayLoop]->mSize;
-
-                            /*
-                            **  Count the number of items with this value.
-                            **  Count the number of items with the opposite equal value.
-                            **  If they are equal, go through and negate all sizes.
-                            */
-                            for(lookLoop = arrayLoop; lookLoop < arrayCount; lookLoop++)
-                            {
-                                /*
-                                **  Skip negated items.
-                                **  Skip zero length items.
-                                */
-                                if(NULL == symArray[lookLoop] || 0 == symArray[lookLoop]->mSize)
-                                {
-                                    continue;
-                                }
-
-                                if(lookingFor == symArray[lookLoop]->mSize)
-                                {
-                                    identicalValues++;
-                                }
-                                else if((-1 * lookingFor) == symArray[lookLoop]->mSize)
-                                {
-                                    oppositeValues++;
-                                }
-                            }
-                            
-                            if(0 != identicalValues && identicalValues == oppositeValues)
-                            {
-                                unsigned negationLoop = 0;
-
-                                for(negationLoop = arrayLoop; 0 != identicalValues || 0 != oppositeValues; negationLoop++)
-                                {
-                                    /*
-                                    **  Skip negated items.
-                                    **  Skip zero length items.
-                                    */
-                                    if(NULL == symArray[negationLoop] || 0 == symArray[negationLoop]->mSize)
-                                    {
-                                        continue;
-                                    }
-
-                                    /*
-                                    **  Negate any size matches.
-                                    **  Reflect the change in the object as well.
-                                    **  Clear the symbol.
-                                    */
-                                    if(lookingFor == symArray[negationLoop]->mSize)
-                                    {
-                                        objArray[negationLoop]->mSize -= lookingFor;
-                                        symArray[negationLoop]->mSize = 0;
-                                        symArray[negationLoop] = NULL;
-
-                                        identicalValues--;
-                                    }
-                                    else if((-1 * lookingFor) == symArray[negationLoop]->mSize)
-                                    {
-                                        objArray[negationLoop]->mSize += lookingFor;
-                                        symArray[negationLoop]->mSize = 0;
-                                        symArray[negationLoop] = NULL;
-
-                                        oppositeValues--;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        CLEANUP(objArray);
-        CLEANUP(symArray);
-    }
-
-
-    /*
-    **  If all went well, time to report.
-    */
-    if(0 == retval)
-    {
-        /*
-        **  Loop through our data once more, so that the symbols can
-        **      propigate their changes upwards in a positive/negative
-        **      fashion.
-        **  This will help give the composite change more meaning.
-        */
-        for(moduleLoop = 0; moduleLoop < moduleCount; moduleLoop++)
-        {
-            theModule = modules + moduleLoop;
-            
-            /*
-            **  Skip if there is zero drift, or no net change.
-            */
-            if(0 == inOptions->mZeroDrift && 0 == (theModule->mSize.mCode + theModule->mSize.mData))
-            {
-                continue;
-            }
-
-            for(segmentLoop = 0; segmentLoop < theModule->mSegmentCount; segmentLoop++)
-            {
-                theSegment = theModule->mSegments + segmentLoop;
-                
-                /*
-                **  Skip if there is zero drift, or no net change.
-                */
-                if(0 == inOptions->mZeroDrift && 0 == theSegment->mSize)
-                {
-                    continue;
-                }
-                
-                for(objectLoop = 0; objectLoop < theSegment->mObjectCount; objectLoop++)
-                {
-                    theObject = theSegment->mObjects + objectLoop;
-                    
-                    /*
-                    **  Skip if there is zero drift, or no net change.
-                    */
-                    if(0 == inOptions->mZeroDrift && 0 == theObject->mSize)
-                    {
-                        continue;
-                    }
-
-                    for(symbolLoop = 0; symbolLoop < theObject->mSymbolCount; symbolLoop++)
-                    {
-                        theSymbol = theObject->mSymbols + symbolLoop;
-                        
-                        /*
-                        **  Propagate the composition all the way to the top.
-                        **  Sizes of zero change are skipped.
-                        */
-                        if(0 < theSymbol->mSize)
-                        {
-                            theObject->mComposition.mPositive += theSymbol->mSize;
-                            theSegment->mComposition.mPositive += theSymbol->mSize;
-                            if(CODE == theSegment->mClass)
-                            {
-                                overall.mCodeComposition.mPositive += theSymbol->mSize;
-                                theModule->mSize.mCodeComposition.mPositive += theSymbol->mSize;
-                            }
-                            else if(DATA == theSegment->mClass)
-                            {
-                                overall.mDataComposition.mPositive += theSymbol->mSize;
-                                theModule->mSize.mDataComposition.mPositive += theSymbol->mSize;
-                            }
-                        }
-                        else if(0 > theSymbol->mSize)
-                        {
-                            theObject->mComposition.mNegative += theSymbol->mSize;
-                            theSegment->mComposition.mNegative += theSymbol->mSize;
-                            if(CODE == theSegment->mClass)
-                            {
-                                overall.mCodeComposition.mNegative += theSymbol->mSize;
-                                theModule->mSize.mCodeComposition.mNegative += theSymbol->mSize;
-                            }
-                            else if(DATA == theSegment->mClass)
-                            {
-                                overall.mDataComposition.mNegative += theSymbol->mSize;
-                                theModule->mSize.mDataComposition.mNegative += theSymbol->mSize;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-
-        if(inOptions->mSummaryOnly)
-        {
-            fprintf(inOptions->mOutput, "%+d (%+d/%+d)\n", overall.mCode + overall.mData, overall.mCodeComposition.mPositive + overall.mDataComposition.mPositive, overall.mCodeComposition.mNegative + overall.mDataComposition.mNegative);
-        }
-        else
-        {
-            fprintf(inOptions->mOutput, "Overall Change in Size\n");
-            fprintf(inOptions->mOutput, "\tTotal:\t%+11d (%+d/%+d)\n", overall.mCode + overall.mData, overall.mCodeComposition.mPositive + overall.mDataComposition.mPositive, overall.mCodeComposition.mNegative + overall.mDataComposition.mNegative);
-            fprintf(inOptions->mOutput, "\tCode:\t%+11d (%+d/%+d)\n", overall.mCode, overall.mCodeComposition.mPositive, overall.mCodeComposition.mNegative);
-            fprintf(inOptions->mOutput, "\tData:\t%+11d (%+d/%+d)\n", overall.mData, overall.mDataComposition.mPositive, overall.mDataComposition.mNegative);
-        }
-
-        /*
-        **  Check what else we should output.
-        */
-        if(0 == inOptions->mSummaryOnly && NULL != modules && moduleCount)
-        {
-            const char* segmentType = NULL;
-
-            /*
-            **  We're going to sort everything.
-            */
-            qsort(modules, moduleCount, sizeof(ModuleStats), moduleCompare);
-            for(moduleLoop = 0; moduleLoop < moduleCount; moduleLoop++)
-            {
-                theModule = modules + moduleLoop;
-
-                qsort(theModule->mSegments, theModule->mSegmentCount, sizeof(SegmentStats), segmentCompare);
-
-                for(segmentLoop = 0; segmentLoop < theModule->mSegmentCount; segmentLoop++)
-                {
-                    theSegment = theModule->mSegments + segmentLoop;
-
-                    qsort(theSegment->mObjects, theSegment->mObjectCount, sizeof(ObjectStats), objectCompare);
-
-                    for(objectLoop = 0; objectLoop < theSegment->mObjectCount; objectLoop++)
-                    {
-                        theObject = theSegment->mObjects + objectLoop;
-
-                        qsort(theObject->mSymbols, theObject->mSymbolCount, sizeof(SymbolStats), symbolCompare);
-                    }
-                }
-            }
-
-            /*
-            **  Loop through for output.
-            */
-            for(moduleLoop = 0; moduleLoop < moduleCount; moduleLoop++)
-            {
-                theModule = modules + moduleLoop;
-
-                /*
-                **  Skip if there is zero drift, or no net change.
-                */
-                if(0 == inOptions->mZeroDrift && 0 == (theModule->mSize.mCode + theModule->mSize.mData))
-                {
-                    continue;
-                }
-
-                fprintf(inOptions->mOutput, "\n");
-                fprintf(inOptions->mOutput, "%s\n", theModule->mModule);
-                fprintf(inOptions->mOutput, "\tTotal:\t%+11d (%+d/%+d)\n", theModule->mSize.mCode + theModule->mSize.mData, theModule->mSize.mCodeComposition.mPositive + theModule->mSize.mDataComposition.mPositive, theModule->mSize.mCodeComposition.mNegative + theModule->mSize.mDataComposition.mNegative);
-                fprintf(inOptions->mOutput, "\tCode:\t%+11d (%+d/%+d)\n", theModule->mSize.mCode, theModule->mSize.mCodeComposition.mPositive, theModule->mSize.mCodeComposition.mNegative);
-                fprintf(inOptions->mOutput, "\tData:\t%+11d (%+d/%+d)\n", theModule->mSize.mData, theModule->mSize.mDataComposition.mPositive, theModule->mSize.mDataComposition.mNegative);
-
-                for(segmentLoop = 0; segmentLoop < theModule->mSegmentCount; segmentLoop++)
-                {
-                    theSegment = theModule->mSegments + segmentLoop;
-
-                    /*
-                    **  Skip if there is zero drift, or no net change.
-                    */
-                    if(0 == inOptions->mZeroDrift && 0 == theSegment->mSize)
-                    {
-                        continue;
-                    }
-
-                    if(CODE == theSegment->mClass)
-                    {
-                        segmentType = "CODE";
-                    }
-                    else if(DATA == theSegment->mClass)
-                    {
-                        segmentType = "DATA";
-                    }
-
-                    fprintf(inOptions->mOutput, "\t%+11d (%+d/%+d)\t%s (%s)\n", theSegment->mSize, theSegment->mComposition.mPositive, theSegment->mComposition.mNegative, theSegment->mSegment, segmentType);
-
-                    for(objectLoop = 0; objectLoop < theSegment->mObjectCount; objectLoop++)
-                    {
-                        theObject = theSegment->mObjects + objectLoop;
-
-                        /*
-                        **  Skip if there is zero drift, or no net change.
-                        */
-                        if(0 == inOptions->mZeroDrift && 0 == theObject->mSize)
-                        {
-                            continue;
-                        }
-
-                        fprintf(inOptions->mOutput, "\t\t%+11d (%+d/%+d)\t%s\n", theObject->mSize, theObject->mComposition.mPositive, theObject->mComposition.mNegative, theObject->mObject);
-                        
-                        for(symbolLoop = 0; symbolLoop < theObject->mSymbolCount; symbolLoop++)
-                        {
-                            theSymbol = theObject->mSymbols + symbolLoop;
-
-                            /*
-                            **  Skip if there is zero drift, or no net change.
-                            */
-                            if(0 == inOptions->mZeroDrift && 0 == theSymbol->mSize)
-                            {
-                                continue;
-                            }
-
-                            fprintf(inOptions->mOutput, "\t\t\t%+11d\t%s\n", theSymbol->mSize, theSymbol->mSymbol);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-    **  Cleanup time.
-    */
-    for(moduleLoop = 0; moduleLoop < moduleCount; moduleLoop++)
-    {
-        theModule = modules + moduleLoop;
-        
-        for(segmentLoop = 0; segmentLoop < theModule->mSegmentCount; segmentLoop++)
-        {
-            theSegment = theModule->mSegments + segmentLoop;
-            
-            for(objectLoop = 0; objectLoop < theSegment->mObjectCount; objectLoop++)
-            {
-                theObject = theSegment->mObjects + objectLoop;
-                
-                for(symbolLoop = 0; symbolLoop < theObject->mSymbolCount; symbolLoop++)
-                {
-                    theSymbol = theObject->mSymbols + symbolLoop;
-                    
-                    CLEANUP(theSymbol->mSymbol);
-                }
-                
-                CLEANUP(theObject->mSymbols);
-                CLEANUP(theObject->mObject);
-            }
-            
-            CLEANUP(theSegment->mObjects);
-            CLEANUP(theSegment->mSegment);
-        }
-        
-        CLEANUP(theModule->mSegments);
-        CLEANUP(theModule->mModule);
-    }
-    CLEANUP(modules);
-    
-    return retval;
-}
-
-
-int initOptions(Options* outOptions, int inArgc, char** inArgv)
-/*
-**  returns int     0 if successful.
-*/
-{
-    int retval = 0;
-    int loop = 0;
-    int switchLoop = 0;
-    int match = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    Switch* current = NULL;
-
-    /*
-    **  Set any defaults.
-    */
-    memset(outOptions, 0, sizeof(Options));
-    outOptions->mProgramName = inArgv[0];
-    outOptions->mInput = stdin;
-    outOptions->mInputName = strdup("stdin");
-    outOptions->mOutput = stdout;
-    outOptions->mOutputName = strdup("stdout");
-
-    if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName)
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup.");
-    }
-
-    /*
-    **  Go through and attempt to do the right thing.
-    */
-    for(loop = 1; loop < inArgc && 0 == retval; loop++)
-    {
-        match = 0;
-        current = NULL;
-
-        for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++)
-        {
-            if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-            else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-
-            if(match)
-            {
-                if(gSwitches[switchLoop]->mHasValue)
-                {
-                    /*
-                    **  Attempt to absorb next option to fullfill value.
-                    */
-                    if(loop + 1 < inArgc)
-                    {
-                        loop++;
-
-                        current = gSwitches[switchLoop];
-                        current->mValue = inArgv[loop];
-                    }
-                }
-                else
-                {
-                    current = gSwitches[switchLoop];
-                }
-
-                break;
-            }
-        }
-
-        if(0 == match)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch.");
-        }
-        else if(NULL == current)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value.");
-        }
-        else
-        {
-            /*
-            ** Do something based on address/swtich.
-            */
-            if(current == &gInputSwitch)
-            {
-                CLEANUP(outOptions->mInputName);
-                if(NULL != outOptions->mInput && stdin != outOptions->mInput)
-                {
-                    fclose(outOptions->mInput);
-                    outOptions->mInput = NULL;
-                }
-
-                outOptions->mInput = fopen(current->mValue, "r");
-                if(NULL == outOptions->mInput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open input file.");
-                }
-                else
-                {
-                    outOptions->mInputName = strdup(current->mValue);
-                    if(NULL == outOptions->mInputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gOutputSwitch)
-            {
-                CLEANUP(outOptions->mOutputName);
-                if(NULL != outOptions->mOutput && stdout != outOptions->mOutput)
-                {
-                    fclose(outOptions->mOutput);
-                    outOptions->mOutput = NULL;
-                }
-
-                outOptions->mOutput = fopen(current->mValue, "a");
-                if(NULL == outOptions->mOutput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open output file.");
-                }
-                else
-                {
-                    outOptions->mOutputName = strdup(current->mValue);
-                    if(NULL == outOptions->mOutputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gHelpSwitch)
-            {
-                outOptions->mHelp = __LINE__;
-            }
-            else if(current == &gSummarySwitch)
-            {
-                outOptions->mSummaryOnly = __LINE__;
-            }
-            else if(current == &gZeroDriftSwitch)
-            {
-                outOptions->mZeroDrift = __LINE__;
-            }
-            else if(current == &gNegationSwitch)
-            {
-                outOptions->mNegation = __LINE__;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, current->mLongName, "No handler for command line switch.");
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-void cleanOptions(Options* inOptions)
-/*
-**  Clean up any open handles.
-*/
-{
-    CLEANUP(inOptions->mInputName);
-    if(NULL != inOptions->mInput && stdin != inOptions->mInput)
-    {
-        fclose(inOptions->mInput);
-    }
-    CLEANUP(inOptions->mOutputName);
-    if(NULL != inOptions->mOutput && stdout != inOptions->mOutput)
-    {
-        fclose(inOptions->mOutput);
-    }
-
-    memset(inOptions, 0, sizeof(Options));
-}
-
-
-void showHelp(Options* inOptions)
-/*
-**  Show some simple help text on usage.
-*/
-{
-    int loop = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    const char* valueText = NULL;
-
-    printf("usage:\t%s [arguments]\n", inOptions->mProgramName);
-    printf("\n");
-    printf("arguments:\n");
-
-    for(loop = 0; loop < switchCount; loop++)
-    {
-        if(gSwitches[loop]->mHasValue)
-        {
-            valueText = " <value>";
-        }
-        else
-        {
-            valueText = "";
-        }
-
-        printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText);
-        printf("\t %s%s", gSwitches[loop]->mShortName, valueText);
-        printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription);
-    }
-
-    printf("This tool takes the diff of two sorted tsv files to form a summary report\n");
-    printf("of code and data size changes which is hoped to be human readable.\n");
-}
-
-
-int main(int inArgc, char** inArgv)
-{
-    int retval = 0;
-    Options options;
-
-    retval = initOptions(&options, inArgc, inArgv);
-    if(options.mHelp)
-    {
-        showHelp(&options);
-    }
-    else if(0 == retval)
-    {
-        retval = difftool(&options);
-    }
-
-    cleanOptions(&options);
-    return retval;
-}
-
deleted file mode 100644
--- a/tools/codesighs/moz.build
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-CSRCS += [
-    'codesighs.c',
-    'maptsvdifftool.c',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
-    CSRCS += [
-        'msdump2symdb.c',
-        'msmap2tsv.c',
-    ]
-else:
-    CSRCS += [
-        'nm2tsv.c',
-    ]
-
-bin_suffix = CONFIG['BIN_SUFFIX']
-SIMPLE_PROGRAMS += [
-    "%s%s" % (x[0:-2], bin_suffix) for x in CSRCS
-]
deleted file mode 100644
--- a/tools/codesighs/msdump2symdb.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-#include <errno.h>
-
-#define ERROR_REPORT(num, val, msg)   fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg));
-#define CLEANUP(ptr)    do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0)
-
-
-typedef struct __struct_Options
-/*
-**  Options to control how we perform.
-**
-**  mProgramName    Used in help text.
-**  mInput          File to read for input.
-**                  Default is stdin.
-**  mInputName      Name of the file.
-**  mOutput         Output file, append.
-**                  Default is stdout.
-**  mOutputName     Name of the file.
-**  mHelp           Whether or not help should be shown.
-*/
-{
-    const char* mProgramName;
-    FILE* mInput;
-    char* mInputName;
-    FILE* mOutput;
-    char* mOutputName;
-    int mHelp;
-}
-Options;
-
-
-typedef struct __struct_Switch
-/*
-**  Command line options.
-*/
-{
-    const char* mLongName;
-    const char* mShortName;
-    int mHasValue;
-    const char* mValue;
-    const char* mDescription;
-}
-Switch;
-
-#define DESC_NEWLINE "\n\t\t"
-
-static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."};
-static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."};
-static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."};
-
-static Switch* gSwitches[] = {
-        &gInputSwitch,
-        &gOutputSwitch,
-        &gHelpSwitch
-};
-
-
-typedef struct __struct_MSDump_Symbol
-/*
-**  Struct to hold infomration on a symbol.
-**
-**  mSize               Size of the symbol once all work is complete.
-**  mOffset             Offset of the symbol in the section.
-**  mName               Symbolic name.
-*/
-{
-    unsigned    mSize;
-    unsigned    mOffset;
-    char*       mName;
-}
-MSDump_Symbol;
-
-
-typedef struct __struct_MSDump_Section
-/*
-**  Struct for holding information on a section.
-**
-**  mLength             Length of the section in bytes.
-**  mUsed               Number of bytes used in the section thus far.
-**                      Should eventually match mLength after work is done.
-**  mType               Type of section, as string (.data, .text, et. al.)
-**  mSymbols            Symbols found inside the section.
-**  mSymbolCount        Number of symbols in array.
-*/
-{
-    unsigned            mLength;
-    unsigned            mUsed;
-    char*               mType;
-
-    MSDump_Symbol*      mSymbols;
-    unsigned            mSymbolCount;
-}
-MSDump_Section;
-
-
-typedef struct __struct_MSDump_Object
-/*
-**  Struct for holding object's data.
-*/
-{
-    char*   mObject;
-
-    MSDump_Section*     mSections;
-    unsigned            mSectionCount;
-}
-MSDump_Object;
-
-
-typedef struct __struct_MSDump_ReadState
-/*
-**  State flags while reading the input gives us hints on what to do.
-**
-**  mSkipLines                  Number of lines to skip without parsing.
-**  mSectionDetails             Section information next, like line length.
-**  mCurrentObject              Object file we are dealing with.
-*/
-{
-    unsigned            mSkipLines;
-    unsigned            mSectionDetails;
-    MSDump_Object*      mCurrentObject;
-}
-MSDump_ReadState;
-
-
-typedef struct __struct_MSDump_Container
-/*
-**  Umbrella container for all data encountered.
-*/
-{
-    MSDump_ReadState    mReadState;
-
-    MSDump_Object*      mObjects;
-    unsigned            mObjectCount;
-}
-MSDump_Container;
-
-
-void trimWhite(char* inString)
-/*
-**  Remove any whitespace from the end of the string.
-*/
-{
-    int len = strlen(inString);
-
-    while(len)
-    {
-        len--;
-
-        if(isspace(*(inString + len)))
-        {
-            *(inString + len) = '\0';
-        }
-        else
-        {
-            break;
-        }
-    }
-}
-
-
-const char* skipWhite(const char* inString)
-/*
-**  Return pointer to first non white space character.
-*/
-{
-    const char* retval = inString;
-
-    while('\0' != *retval && isspace(*retval))
-    {
-        retval++;
-    }
-
-    return retval;
-}
-
-
-const char* skipNonWhite(const char* inString)
-/*
-**  Return pointer to first white space character.
-*/
-{
-    const char* retval = inString;
-
-    while('\0' != *retval && !isspace(*retval))
-    {
-        retval++;
-    }
-
-    return retval;
-}
-
-
-void slash2bs(char* inString)
-/*
-**  Change any forward slash to a backslash.
-*/
-{
-    char* slash = inString;
-
-    while(NULL != (slash = strchr(slash, '/')))
-    {
-        *slash = '\\';
-        slash++;
-    }
-}
-
-
-const char* skipToArg(const char* inString, unsigned inArgIndex)
-/*
-**  Return pointer either to the arg or NULL.
-**  1 indexed.
-*/
-{
-    const char* retval = NULL;
-
-    while(0 != inArgIndex && '\0' != *inString)
-    {
-        inArgIndex--;
-
-        inString = skipWhite(inString);
-        if(0 != inArgIndex)
-        {
-            inString = skipNonWhite(inString);
-        }
-    }
-
-    if('\0' != *inString)
-    {
-        retval = inString;
-    }
-
-    return retval;
-}
-
-
-const char* getLastArg(const char* inString)
-/*
-**  Return pointer to last arg in string.
-*/
-{
-    const char* retval = NULL;
-    int length = 0;
-    int sawString = 0;
-
-    length = strlen(inString);
-    while(0 != length)
-    {
-        length--;
-
-        if(0 == sawString)
-        {
-            if(0 == isspace(inString[length]))
-            {
-                sawString = __LINE__;
-            }
-        }
-        else
-        {
-            if(0 != isspace(inString[length]))
-            {
-                retval = inString + length + 1;
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-int processLine(Options* inOptions, MSDump_Container* inContainer, const char* inLine)
-/*
-**  Handle one line at a time.
-**  Looking for several different types of lines.
-**  Ignore all other lines.
-**  The container is the state machine.
-**  returns 0 on no error.
-*/
-{
-    int retval = 0;
-
-    /*
-    **  Check to see if we were expecting section details.
-    */
-    if(0 != inContainer->mReadState.mSectionDetails)
-    {
-        const char* length = NULL;
-        unsigned sectionIndex = 0;
-
-        /*
-        **  Detail is a 1 based index....
-        **  Reset.
-        */
-        sectionIndex = inContainer->mReadState.mSectionDetails - 1;
-        inContainer->mReadState.mSectionDetails = 0;
-
-        if(0 == strncmp("    Section length", inLine, 18))
-        {
-            const char* sectionLength = NULL;
-            unsigned numericLength = 0;
-            char* endScan = NULL;
-
-            sectionLength = skipWhite(inLine + 18);
-
-            errno = 0;
-            numericLength = strtoul(sectionLength, &endScan, 16);
-            if(0 == errno && endScan != sectionLength)
-            {
-                inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mLength = numericLength;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, inLine, "Cannot scan for section length.");
-            }
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, inLine, "Cannot parse section line.");
-        }
-    }
-    /*
-    **  Check for switching object file symbols.
-    */
-    else if(0 == strncmp("Dump of file ", inLine, 13))
-    {
-        const char* dupMe = inLine + 13;
-        char* dup = NULL;
-        
-        dup = strdup(dupMe);
-        if(NULL != dup)
-        {
-            void* growth = NULL;
-            
-            trimWhite(dup);
-            slash2bs(dup);
-            
-            
-            growth = realloc(inContainer->mObjects, (inContainer->mObjectCount + 1) * sizeof(MSDump_Object));
-            if(NULL != growth)
-            {
-                unsigned int index = inContainer->mObjectCount;
-                
-                inContainer->mObjectCount++;
-                inContainer->mObjects = growth;
-                memset(inContainer->mObjects + index, 0, sizeof(MSDump_Object));
-                
-                inContainer->mObjects[index].mObject = dup;
-
-                /*
-                **  Reset the read state for this new object.
-                */
-                memset(&inContainer->mReadState, 0, sizeof(MSDump_ReadState));
-
-                /*
-                **  Record our current object file.
-                */
-                inContainer->mReadState.mCurrentObject = inContainer->mObjects + index;
-
-                /*
-                **  We can skip a few lines.
-                */
-                inContainer->mReadState.mSkipLines = 4;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, dup, "Unable to grow object array.");
-                free(dup);
-            }
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, dupMe, "Unable to copy string.");
-            
-        }
-    }
-    /*
-    **  Check for a symbol dump or a section header.
-    */
-    else if(isxdigit(*inLine) && isxdigit(*(inLine + 1)) && isxdigit(*(inLine + 2)))
-    {
-        const char* sectionString = NULL;
-
-        /*
-        **  Determine the section for this line.
-        **  Ignore DEBUG sections.
-        */
-        sectionString = skipToArg(inLine, 3);
-        if(NULL != sectionString)
-        {
-            if(0 != strncmp(sectionString, "DEBUG", 5) && 0 != strncmp(sectionString, "ABS", 3) && 0 != strncmp(sectionString, "UNDEF", 5))
-            {
-                /*
-                **  MUST start with "SECT"
-                */
-                if(0 == strncmp(sectionString, "SECT", 4))
-                {
-                    unsigned sectionIndex1 = 0;
-
-                    char *endScan = NULL;
-
-                    sectionString += 4;
-
-                    /*
-                    **  Convert the remaining string to an index.
-                    **  It will be 1 based.
-                    */
-                    errno = 0;
-                    sectionIndex1 = strtoul(sectionString, &endScan, 16);
-                    if(0 == errno && endScan != sectionString && 0 != sectionIndex1)
-                    {
-                        unsigned sectionIndex = sectionIndex1 - 1;
-
-                        /*
-                        **  Is this a new section? Assumed to be ascending.
-                        **  Or is this a symbol in the section?
-                        */
-                        if(sectionIndex1 > inContainer->mReadState.mCurrentObject->mSectionCount)
-                        {
-                            const char* typeArg = NULL;
-
-                            /*
-                            **  New Section, figure out the type.
-                            */
-                            typeArg = skipToArg(sectionString, 5);
-                            if(NULL != typeArg)
-                            {
-                                char* typeDup = NULL;
-
-                                /*
-                                **  Skip the leading period before duping.
-                                */
-                                if('.' == *typeArg)
-                                {
-                                    typeArg++;
-                                }
-                                typeDup = strdup(typeArg);
-
-                                if(NULL != typeDup)
-                                {
-                                    void* moved = NULL;
-                                    char* nonWhite = NULL;
-
-                                    /*
-                                    **  Terminate the duplicate after the section type.
-                                    */
-                                    nonWhite = (char*)skipNonWhite(typeDup);
-                                    if(NULL != nonWhite)
-                                    {
-                                        *nonWhite = '\0';
-                                    }
-
-                                    /*
-                                    **  Create more space for the section in the object...
-                                    */
-                                    moved = realloc(inContainer->mReadState.mCurrentObject->mSections, sizeof(MSDump_Section) * sectionIndex1);
-                                    if(NULL != moved)
-                                    {
-                                        unsigned oldCount = inContainer->mReadState.mCurrentObject->mSectionCount;
-
-                                        inContainer->mReadState.mCurrentObject->mSections = (MSDump_Section*)moved;
-                                        inContainer->mReadState.mCurrentObject->mSectionCount = sectionIndex1;
-                                        memset(&inContainer->mReadState.mCurrentObject->mSections[oldCount], 0, sizeof(MSDump_Section) * (sectionIndex1 - oldCount));
-                                        
-                                        /*
-                                        **  Other section details.
-                                        */
-                                        inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mType = typeDup;
-                                            
-                                            
-                                        /*
-                                        **  Mark it so that we look for the length on the next line.
-                                        **  This happens on next entry into the read state.
-                                        */
-                                        inContainer->mReadState.mSectionDetails = sectionIndex1;
-                                    }
-                                    else
-                                    {
-                                        retval = __LINE__;
-                                        ERROR_REPORT(retval, inLine, "Unable to grow for new section.");
-                                        free(typeDup);
-                                    }
-                                }
-                                else
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, typeArg, "Unable to duplicate type.");
-                                }
-                            }
-                            else
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, inLine, "Unable to determine section type.");
-                            }
-
-                        }
-                        else
-                        {
-                            const char* offsetArg = NULL;
-                            const char* classArg = NULL;
-                            unsigned classWords = 1;
-                            const char* symbolArg = NULL;
-
-                            /*
-                            **  This is an section we've seen before, and must list a symbol.
-                            **  Figure out the things we want to know about the symbol, e.g. size.
-                            **  We will ignore particular classes of symbols.
-                            */
-
-                            offsetArg = skipToArg(inLine, 2);
-
-                            classArg = skipToArg(offsetArg, 4);
-                            if(0 == strncmp(classArg, "()", 2))
-                            {
-                                classArg = skipToArg(classArg, 2);
-                            }
-                            if(0 == strncmp(classArg, ".bf or.ef", 9))
-                            {
-                                classWords = 2;
-                            }
-
-                            symbolArg = skipToArg(classArg, 3 + (classWords - 1));
-
-                            /*
-                            **  Skip particular lines/items.
-                            */
-                            if(
-                                0 != strncmp(classArg, "Label", 5) &&
-                                0 != strncmp(symbolArg, ".bf", 3) &&
-                                0 != strncmp(symbolArg, ".lf", 3) &&
-                                0 != strncmp(symbolArg, ".ef", 3)
-                                )
-                            {
-                                char* endOffsetArg = NULL;
-                                unsigned offset = 0;
-                                
-                                /*
-                                ** Convert the offset to something meaninful (size).
-                                */
-                                errno = 0;
-                                offset = strtoul(offsetArg, &endOffsetArg, 16);
-                                if(0 == errno && endOffsetArg != offsetArg)
-                                {
-                                    void* moved = NULL;
-                                    
-                                    /*
-                                    **  Increase the size of the symbol array in the section.
-                                    **  Assumed symbols are unique within each section.
-                                    */
-                                    moved = realloc(inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols, sizeof(MSDump_Symbol) * (inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbolCount + 1));
-                                    if(NULL != moved)
-                                    {
-                                        unsigned symIndex = 0;
-
-                                        /*
-                                        **  Record symbol details.
-                                        **  Assumed symbols are encountered in order for their section (size calc depends on it).
-                                        */
-                                        symIndex = inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbolCount;
-                                        inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbolCount++;
-                                        inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols = (MSDump_Symbol*)moved;
-                                        memset(&inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols[symIndex], 0, sizeof(MSDump_Symbol));
-                                        
-                                        inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols[symIndex].mOffset = offset;
-                                        
-                                        /*
-                                        **  We could allocate smarter here if it ever mattered.
-                                        */
-                                        inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols[symIndex].mName = strdup(symbolArg);
-                                        if(NULL != inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols[symIndex].mName)
-                                        {
-                                            char* trim = NULL;
-
-                                            trim = (char*)skipNonWhite(inContainer->mReadState.mCurrentObject->mSections[sectionIndex].mSymbols[symIndex].mName);
-                                            if(NULL != trim)
-                                            {
-                                                *trim = '\0';
-                                            }
-                                        }
-                                        else
-                                        {
-                                            retval = __LINE__;
-                                            ERROR_REPORT(retval, inLine, "Unable to duplicate symbol name.");
-                                        }
-                                    }
-                                    else
-                                    {
-                                        retval = __LINE__;
-                                        ERROR_REPORT(retval, inLine, "Unable to grow symbol array for section.");
-                                    }
-                                }
-                                else
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, inLine, "Unable to convert offset to a number.");
-                                }
-                            }
-                        }
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, inLine, "Unable to determine section index.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, inLine, "No match for section prefix.");
-                }
-            }
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, inLine, "Unable to scan for section.");
-        }
-    }
-
-    return retval;
-}
-
-
-void dumpCleanup(MSDump_Container* inContainer)
-/*
-**  Attempt to be nice and free up what we have allocated.
-*/
-{
-    unsigned objectLoop = 0;
-    unsigned sectionLoop = 0;
-    unsigned symbolLoop = 0;
-
-    for(objectLoop = 0; objectLoop < inContainer->mObjectCount; objectLoop++)
-    {
-        for(sectionLoop = 0; sectionLoop < inContainer->mObjects[objectLoop].mSectionCount; sectionLoop++)
-        {
-            for(symbolLoop = 0; symbolLoop < inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbolCount; symbolLoop++)
-            {
-                CLEANUP(inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols[symbolLoop].mName);
-            }
-            inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbolCount = 0;
-            CLEANUP(inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols);
-            CLEANUP(inContainer->mObjects[objectLoop].mSections[sectionLoop].mType);
-        }
-        inContainer->mObjects[objectLoop].mSectionCount = 0;
-        CLEANUP(inContainer->mObjects[objectLoop].mSections);
-    }
-    CLEANUP(inContainer->mObjects);
-    inContainer->mObjectCount = 0;
-}
-
-
-int qsortSymOffset(const void* in1, const void* in2)
-/*
-**  qsort callback to sort the symbols by their offset.
-*/
-{
-    MSDump_Symbol* sym1 = (MSDump_Symbol*)in1;
-    MSDump_Symbol* sym2 = (MSDump_Symbol*)in2;
-    int retval = 0;
-
-    if(sym1->mOffset < sym2->mOffset)
-    {
-        retval = 1;
-    }
-    else if(sym1->mOffset > sym2->mOffset)
-    {
-        retval = -1;
-    }
-
-    return retval;
-}
-
-
-int calcContainer(Options* inOptions, MSDump_Container* inContainer)
-/*
-**  Resposible for doing any size calculations based on the offsets known.
-**  After this calculation, each sections mUsed will match mSize.
-**  After this calculation, all symbols should know how big they are.
-*/
-{
-    int retval = 0;
-    unsigned objectLoop = 0;
-    unsigned sectionLoop = 0;
-    unsigned symbolLoop = 0;
-
-
-    /*
-    **  Need to sort all symbols by their offsets.
-    */
-    for(objectLoop = 0; 0 == retval && objectLoop < inContainer->mObjectCount; objectLoop++)
-    {
-        for(sectionLoop = 0; 0 == retval && sectionLoop < inContainer->mObjects[objectLoop].mSectionCount; sectionLoop++)
-        {
-            qsort(
-                inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols,
-                inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbolCount,
-                sizeof(MSDump_Symbol),
-                qsortSymOffset
-                );
-        }
-    }
-
-
-    /*
-    **  Need to go through all symbols and calculate their size.
-    */
-    for(objectLoop = 0; 0 == retval && objectLoop < inContainer->mObjectCount; objectLoop++)
-    {
-        for(sectionLoop = 0; 0 == retval && sectionLoop < inContainer->mObjects[objectLoop].mSectionCount; sectionLoop++)
-        {
-            for(symbolLoop = 0; 0 == retval && symbolLoop < inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbolCount; symbolLoop++)
-            {
-                inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols[symbolLoop].mSize =
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mLength -
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mUsed -
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols[symbolLoop].mOffset;
-
-                inContainer->mObjects[objectLoop].mSections[sectionLoop].mUsed += 
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols[symbolLoop].mSize;
-            }
-        }
-    }
-
-
-    return retval;
-}
-
-
-int reportContainer(Options* inOptions, MSDump_Container* inContainer)
-/*
-**  Display all symbols and their data.
-**  We'll use a tsv format.
-*/
-{
-    int retval = 0;
-    unsigned objectLoop = 0;
-    unsigned sectionLoop = 0;
-    unsigned symbolLoop = 0;
-    int printRes = 0;
-
-    for(objectLoop = 0; 0 == retval && objectLoop < inContainer->mObjectCount; objectLoop++)
-    {
-        for(sectionLoop = 0; 0 == retval && sectionLoop < inContainer->mObjects[objectLoop].mSectionCount; sectionLoop++)
-        {
-            for(symbolLoop = 0; 0 == retval && symbolLoop < inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbolCount; symbolLoop++)
-            {
-                printRes = fprintf(inOptions->mOutput, "%s\t%s\t%.8X\t%s\n",
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols[symbolLoop].mName,
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mType,
-                    inContainer->mObjects[objectLoop].mSections[sectionLoop].mSymbols[symbolLoop].mSize,
-                    inContainer->mObjects[objectLoop].mObject
-                    );
-
-                if(0 > printRes)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, inOptions->mOutputName, "Unable to write to file.");
-                }
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-int dump2symdb(Options* inOptions)
-/*
-**  Convert the input into the output, respecting the options.
-**  Returns 0 on success.
-*/
-{
-    int retval = 0;
-    char lineBuffer[0x800];
-    MSDump_Container container;
-
-    memset(&container, 0, sizeof(container));
-
-    /*
-    **  Read the file line by line.
-    */
-    while(0 == retval && NULL != fgets(lineBuffer, sizeof(lineBuffer), inOptions->mInput))
-    {
-        if(0 != container.mReadState.mSkipLines)
-        {
-            container.mReadState.mSkipLines--;
-            continue;
-        }
-        retval = processLine(inOptions, &container, lineBuffer);
-    }
-
-    /*
-    **  Perform whatever calculations desired.
-    */
-    if(0 == retval)
-    {
-        retval = calcContainer(inOptions, &container);
-    }
-
-    /*
-    **  Output what we know.
-    */
-    if(0 == retval)
-    {
-        retval = reportContainer(inOptions, &container);
-    }
-
-    /*
-    **  Cleanup what we've done.
-    */
-    dumpCleanup(&container);
-
-    return retval;
-}
-
-
-int initOptions(Options* outOptions, int inArgc, char** inArgv)
-/*
-**  returns int     0 if successful.
-*/
-{
-    int retval = 0;
-    int loop = 0;
-    int switchLoop = 0;
-    int match = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    Switch* current = NULL;
-
-    /*
-    **  Set any defaults.
-    */
-    memset(outOptions, 0, sizeof(Options));
-    outOptions->mProgramName = inArgv[0];
-    outOptions->mInput = stdin;
-    outOptions->mInputName = strdup("stdin");
-    outOptions->mOutput = stdout;
-    outOptions->mOutputName = strdup("stdout");
-
-    if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName)
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup.");
-    }
-
-    /*
-    **  Go through and attempt to do the right thing.
-    */
-    for(loop = 1; loop < inArgc && 0 == retval; loop++)
-    {
-        match = 0;
-        current = NULL;
-
-        for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++)
-        {
-            if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-            else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-
-            if(match)
-            {
-                if(gSwitches[switchLoop]->mHasValue)
-                {
-                    /*
-                    **  Attempt to absorb next option to fullfill value.
-                    */
-                    if(loop + 1 < inArgc)
-                    {
-                        loop++;
-
-                        current = gSwitches[switchLoop];
-                        current->mValue = inArgv[loop];
-                    }
-                }
-                else
-                {
-                    current = gSwitches[switchLoop];
-                }
-
-                break;
-            }
-        }
-
-        if(0 == match)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch.");
-        }
-        else if(NULL == current)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value.");
-        }
-        else
-        {
-            /*
-            ** Do something based on address/swtich.
-            */
-            if(current == &gInputSwitch)
-            {
-                CLEANUP(outOptions->mInputName);
-                if(NULL != outOptions->mInput && stdin != outOptions->mInput)
-                {
-                    fclose(outOptions->mInput);
-                    outOptions->mInput = NULL;
-                }
-
-                outOptions->mInput = fopen(current->mValue, "r");
-                if(NULL == outOptions->mInput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open input file.");
-                }
-                else
-                {
-                    outOptions->mInputName = strdup(current->mValue);
-                    if(NULL == outOptions->mInputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gOutputSwitch)
-            {
-                CLEANUP(outOptions->mOutputName);
-                if(NULL != outOptions->mOutput && stdout != outOptions->mOutput)
-                {
-                    fclose(outOptions->mOutput);
-                    outOptions->mOutput = NULL;
-                }
-
-                outOptions->mOutput = fopen(current->mValue, "a");
-                if(NULL == outOptions->mOutput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open output file.");
-                }
-                else
-                {
-                    outOptions->mOutputName = strdup(current->mValue);
-                    if(NULL == outOptions->mOutputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gHelpSwitch)
-            {
-                outOptions->mHelp = __LINE__;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, current->mLongName, "No handler for command line switch.");
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-void cleanOptions(Options* inOptions)
-/*
-**  Clean up any open handles.
-*/
-{
-    CLEANUP(inOptions->mInputName);
-    if(NULL != inOptions->mInput && stdin != inOptions->mInput)
-    {
-        fclose(inOptions->mInput);
-    }
-    CLEANUP(inOptions->mOutputName);
-    if(NULL != inOptions->mOutput && stdout != inOptions->mOutput)
-    {
-        fclose(inOptions->mOutput);
-    }
-
-    memset(inOptions, 0, sizeof(Options));
-}
-
-
-void showHelp(Options* inOptions)
-/*
-**  Show some simple help text on usage.
-*/
-{
-    int loop = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    const char* valueText = NULL;
-
-    printf("usage:\t%s [arguments]\n", inOptions->mProgramName);
-    printf("\n");
-    printf("arguments:\n");
-
-    for(loop = 0; loop < switchCount; loop++)
-    {
-        if(gSwitches[loop]->mHasValue)
-        {
-            valueText = " <value>";
-        }
-        else
-        {
-            valueText = "";
-        }
-
-        printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText);
-        printf("\t %s%s", gSwitches[loop]->mShortName, valueText);
-        printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription);
-    }
-
-    printf("This tool takes the output of \"dumpbin /symbols\" to produce a simple\n");
-    printf("tsv db file of symbols and their respective attributes, like size.\n");
-}
-
-
-int main(int inArgc, char** inArgv)
-{
-    int retval = 0;
-    Options options;
-
-    retval = initOptions(&options, inArgc, inArgv);
-    if(options.mHelp)
-    {
-        showHelp(&options);
-    }
-    else if(0 == retval)
-    {
-        retval = dump2symdb(&options);
-    }
-
-    cleanOptions(&options);
-    return retval;
-}
-
deleted file mode 100644
--- a/tools/codesighs/msmap.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#if !defined __msmap_H
-#define __msmap_H
-
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-
-/*
-**  Used to numerically represent addresses.
-*/
-typedef unsigned long address;
-
-
-typedef enum __enum_MSMap_SymbolScope
-/*
-**  Symbol scope.
-*/
-{
-    PUBLIC,
-    STATIC,
-    UNDEFINED
-}
-MSMap_SymbolScope;
-
-
-typedef enum __enum_MSMap_SegmentClass
-/*
-**  Segment class.
-*/
-{
-    CODE,
-    DATA
-}
-MSMap_SegmentClass;
-
-
-typedef struct __struct_MSMap_Segment
-/*
-**  Information about a segment.
-*/
-{
-    address mPrefix;
-    address mOffset;
-    address mLength;
-    address mUsed;
-    char* mSegment;
-    MSMap_SegmentClass mClass;
-}
-MSMap_Segment;
-
-
-typedef struct __struct_MSMap_Symbol
-/*
-**  Information about a symbol.
-*/
-{
-    address mPrefix;
-    address mOffset;
-    char* mSymbol;
-    address mRVABase;
-    char* mObject;
-    MSMap_SymbolScope mScope;
-    unsigned mSymDBSize;
-    MSMap_Segment* mSection;
-}
-MSMap_Symbol;
-
-
-typedef struct __struct_MSMap_Module
-/*
-**  Top level container of the map data.
-*/
-{
-    char* mModule;
-    time_t mTimestamp;
-    address mPreferredLoadAddress;
-    MSMap_Segment* mSegments;
-    unsigned mSegmentCount;
-    unsigned mSegmentCapacity;
-    address mEntryPrefix;
-    address mEntryOffset;
-    MSMap_Symbol* mSymbols;
-    unsigned mSymbolCount;
-    unsigned mSymbolCapacity;
-}
-MSMap_Module;
-
-
-/*
-**  How much to grow our arrays by.
-*/
-#define MSMAP_SEGMENT_GROWBY 0x10
-#define MSMAP_SYMBOL_GROWBY  0x100
-
-
-#if 0
-{
-#endif
-#if defined(__cplusplus)
-} /* extern "C" */
-#endif
-
-
-#endif /* __msmap_H */
deleted file mode 100644
--- a/tools/codesighs/msmap2tsv.c
+++ /dev/null
@@ -1,2208 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include "msmap.h"
-
-#if defined(_WIN32)
-#include <windows.h>
-#include <imagehlp.h>
-
-#define F_DEMANGLE 1
-#define DEMANGLE_STATE_NORMAL 0
-#define DEMANGLE_STATE_QDECODE 1
-#define DEMANGLE_STATE_PROLOGUE_1 2
-#define DEMANGLE_STATE_HAVE_TYPE 3
-#define DEMANGLE_STATE_DEC_LENGTH 4
-#define DEMANGLE_STATE_HEX_LENGTH 5
-#define DEMANGLE_STATE_PROLOGUE_SECONDARY 6
-#define DEMANGLE_STATE_DOLLAR_1 7
-#define DEMANGLE_STATE_DOLLAR_2 8
-#define DEMANGLE_STATE_START 9
-#define DEMANGLE_STATE_STOP 10
-#define DEMANGLE_SAFE_CHAR(eval)  (isprint(eval) ? eval : ' ')
-
-#else
-#define F_DEMANGLE 0
-#endif /* WIN32 */
-
-#define STRINGIFY(s_) STRINGIFY2(s_)
-#define STRINGIFY2(s_) #s_
-#define SYMBOL_BUF_CHARS 511
-
-#define ERROR_REPORT(num, val, msg)   fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg));
-#define CLEANUP(ptr)    do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0)
-
-
-typedef struct __struct_SymDB_Size
-/*
-**  The size of the symbol.
-**  The size is nested withing a symbols structures to produce a fast
-**      lookup path.
-**  The objects are listed in case the client of the symdb needs to
-**      match the object name in the scenario where multiple symbol
-**      sizes are present.
-**
-**  mSize           The size of the symbol in these objects.
-**  mObjects        A list of objects containing said symbol.
-**  mObjectCount    Number of objects.
-*/
-{
-    unsigned            mSize;
-    char**              mObjects;
-    unsigned            mObjectCount;
-}
-SymDB_Size;
-
-
-typedef struct __struct_SymDB_Section
-/*
-**  Each section for a symbol has a list of sizes.
-**  Should there be exactly one size for the symbol, then that
-**      is the size that should be accepted.
-**  If there is more than one size, then a match on the object
-**      should be attempted, held withing each size.
-**
-**  mName           The section name.
-**  mSizes          The varoius sizes of the symbol in this section.
-**  mSizeCount      The number of available sizes.
-*/
-{
-    char*               mName;
-    SymDB_Size*         mSizes;
-    unsigned            mSizeCount;
-}
-SymDB_Section;
-
-
-typedef struct __struct_SymDB_Symbol
-/*
-**  Each symbol has at least one section.
-**  The section indicates what type of symbol a client may be looking for.
-**  If there is no match on the section, then the client should not trust
-**      the symbdb.
-**
-**  mName           The mangled name of the symbol.
-**  mSections       Various sections this symbol belongs to.
-**  mSectionCount   The number of sections.
-*/
-{
-    char*               mName;
-    SymDB_Section*      mSections;
-    unsigned            mSectionCount;
-}
-SymDB_Symbol;
-
-
-#define SYMDB_SYMBOL_GROWBY 0x1000 /* how many sybols to allocate at a time */
-
-
-typedef struct __struct_SymDB_Container
-/*
-**  The symbol DB container object.
-**  The goal of the symbol DB is to have exactly one SymDB_Symbol for each
-**      mangled name, no matter how ever many identical mangled names there
-**      are in the input.
-**  The input is already expected to be well sorted, futher this leads to
-**      the ability to binary search for symbol name matches.
-**
-**  mSymbols        The symbols.
-**  mSymbolCount    The number of symbols in the DB.
-**  mSymbolCapacity The number of symbols we can hold (before realloc).
-*/
-{
-    SymDB_Symbol*       mSymbols;
-    unsigned            mSymbolCount;
-    unsigned            mSymbolCapacity;
-}
-SymDB_Container;
-
-
-typedef struct __struct_Options
-/*
-**  Options to control how we perform.
-**
-**  mProgramName        Used in help text.
-**  mInput              File to read for input.
-**                      Default is stdin.
-**  mInputName          Name of the file.
-**  mOutput             Output file, append.
-**                      Default is stdout.
-**  mOutputName         Name of the file.
-**  mHelp               Whether or not help should be shown.
-**  mMatchModules       Array of strings which the module name should match.
-**  mMatchModuleCount   Number of items in array.
-**  mSymDBName          Symbol DB filename.
-**  mBatchMode          Batch mode.
-**                      When in batch mode, the input file contains a list of
-**                          map files to process.
-**                      Normally the input file is a single map file itself.
-*/
-{
-    const char* mProgramName;
-    FILE* mInput;
-    char* mInputName;
-    FILE* mOutput;
-    char* mOutputName;
-    int mHelp;
-    char** mMatchModules;
-    unsigned mMatchModuleCount;
-    char* mSymDBName;
-    SymDB_Container* mSymDB;
-    int mBatchMode;
-}
-Options;
-
-
-typedef struct __struct_Switch
-/*
-**  Command line options.
-*/
-{
-    const char* mLongName;
-    const char* mShortName;
-    int mHasValue;
-    const char* mValue;
-    const char* mDescription;
-}
-Switch;
-
-#define DESC_NEWLINE "\n\t\t"
-
-static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."};
-static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."};
-static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."};
-static Switch gMatchModuleSwitch = {"--match-module", "-mm", 1, NULL, "Specify a valid module name." DESC_NEWLINE "Multiple specifications allowed." DESC_NEWLINE "If a module name does not match one of the names specified then no output will occur."};
-static Switch gSymDBSwitch = {"--symdb", "-sdb", 1, NULL, "Specify a symbol tsv db input file." DESC_NEWLINE "Such a symdb is produced using the tool msdump2symdb." DESC_NEWLINE "This allows better symbol size approximations." DESC_NEWLINE "The symdb file must be pre-sorted."};
-static Switch gBatchModeSwitch = {"--batch", "-b", 0, NULL, "Runs in batch mode." DESC_NEWLINE "The input file contains a list of map files." DESC_NEWLINE "Normally the input file is a map file itself." DESC_NEWLINE "This eliminates reprocessing the symdb for multiple map files."};
-
-static Switch* gSwitches[] = {
-        &gInputSwitch,
-        &gOutputSwitch,
-        &gMatchModuleSwitch,
-        &gSymDBSwitch,
-        &gBatchModeSwitch,
-        &gHelpSwitch
-};
-
-
-typedef struct __struct_MSMap_ReadState
-/*
-**  Keep track of what state we are while reading input.
-**  This gives the input context in which we absorb the datum.
-*/
-{
-    int mHasModule;
-
-    int mHasTimestamp;
-
-    int mHasPreferredLoadAddress;
-
-    int mHasSegmentData;
-    int mSegmentDataSkippedLine;
-
-    int mHasPublicSymbolData;
-    int mHasPublicSymbolDataSkippedLines;
-
-    int mHasEntryPoint;
-
-    int mFoundStaticSymbols;
-}
-MSMap_ReadState;
-
-
-char* skipWhite(char* inScan)
-/*
-**  Skip whitespace.
-*/
-{
-    char* retval = inScan;
-
-    while(isspace(*retval))
-    {
-        retval++;
-    }
-
-    return retval;
-}
-
-void trimWhite(char* inString)
-/*
-**  Remove any whitespace from the end of the string.
-*/
-{
-    int len = strlen(inString);
-
-    while(len)
-    {
-        len--;
-
-        if(isspace(*(inString + len)))
-        {
-            *(inString + len) = '\0';
-        }
-        else
-        {
-            break;
-        }
-    }
-}
-
-
-char* lastWord(char* inString)
-/*
-**  Finds and returns the last word in a string.
-**  It is assumed no whitespace is at the end of the string.
-*/
-{
-    int mod = 0;
-    int len = strlen(inString);
-
-    while(len)
-    {
-        len--;
-        if(isspace(*(inString + len)))
-        {
-            mod = 1;
-            break;
-        }
-    }
-
-    return inString + len + mod;
-}
-
-
-MSMap_Segment* getSymbolSection(MSMap_Module* inModule, MSMap_Symbol* inoutSymbol)
-/*
-**  Perform a lookup for the section of the symbol.
-**  The function could cache the value.
-*/
-{
-    MSMap_Segment* retval = NULL;
-
-    if(NULL != inoutSymbol->mSection)
-    {
-        /*
-        **  Use cached value.
-        */
-        retval = inoutSymbol->mSection;
-    }
-    else
-    {
-        unsigned secLoop = 0;
-
-        /*
-        **  Go through sections in module to find the match for the symbol.
-        */
-        for(secLoop = 0; secLoop < inModule->mSegmentCount; secLoop++)
-        {
-            if(inoutSymbol->mPrefix == inModule->mSegments[secLoop].mPrefix)
-            {
-                if(inoutSymbol->mOffset >= inModule->mSegments[secLoop].mOffset)
-                {
-                    if(inoutSymbol->mOffset < (inModule->mSegments[secLoop].mOffset + inModule->mSegments[secLoop].mLength))
-                    {
-                        /*
-                        **  We have the section.
-                        */
-                        retval = &inModule->mSegments[secLoop];
-                        break;
-                    }
-                }
-            }
-        }
-
-        /*
-        **  Cache the value for next time.
-        */
-        inoutSymbol->mSection = retval;
-    }
-
-    return retval;
-}
-
-
-int readSymDB(const char* inDBName, SymDB_Container** outDB)
-/*
-**  Intialize the symbol DB.
-**  Only call if the symbol DB should be initialized.
-*/
-{
-    int retval = 0;
-
-    /*
-    **  Initialize out arguments.
-    */
-    if(NULL != outDB)
-    {
-        *outDB = NULL;
-    }
-
-    if(NULL != outDB && NULL != inDBName)
-    {
-        FILE* symDB = NULL;
-
-        symDB = fopen(inDBName, "r");
-        if(NULL != symDB)
-        {
-            *outDB = (SymDB_Container*)calloc(1, sizeof(SymDB_Container));
-            if(NULL != *outDB)
-            {
-                char lineBuf[0x400];
-                char* symbol = NULL;
-                char* section = NULL;
-                char* object = NULL;
-                char* length = NULL;
-                unsigned lengthNum = 0;
-                char* endLength = NULL;
-                
-                /*
-                **  Read the file line by line.
-                */
-                while(0 == retval && NULL != fgets(lineBuf, sizeof(lineBuf), symDB))
-                {
-                    trimWhite(lineBuf);
-                    
-                    /*
-                    **  Each line has four arguments.  tab separated values (tsv).
-                    **      Symbol
-                    **      Section
-                    **      Length
-                    **      Object
-                    */
-                    
-                    symbol = skipWhite(lineBuf);
-                    if(NULL == symbol)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, inDBName, "File does not appear to be a symbol DB.");
-                        break;
-                    }
-                    
-                    section = strchr(symbol, '\t');
-                    if(NULL == section)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, inDBName, "File does not appear to be a symbol DB.");
-                        break;
-                    }
-                    *section = '\0';
-                    section++;
-                    
-                    length = strchr(section, '\t');
-                    if(NULL == length)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, inDBName, "File does not appear to be a symbol DB.");
-                        break;
-                    }
-                    *length = '\0';
-                    length++;
-                    
-                    object = strchr(length, '\t');
-                    if(NULL == object)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, inDBName, "File does not appear to be a symbol DB.");
-                        break;
-                    }
-                    *object = '\0';
-                    object++;
-                    
-                    /*
-                    **  Convert the length into a number.
-                    */
-                    errno = 0;
-                    lengthNum = strtoul(length, &endLength, 16);
-                    if(0 == errno && endLength != length)
-                    {
-                        SymDB_Symbol* dbSymbol = NULL;
-                        SymDB_Section* dbSection = NULL;
-                        SymDB_Size* dbSize = NULL;
-                        char* dbObject = NULL;
-                        void* moved = NULL;
-                        
-                        /*
-                        **  Are we looking at the same symbol as last line?
-                        **  This assumes the symdb is pre sorted!!!
-                        */
-                        if(0 != (*outDB)->mSymbolCount)
-                        {
-                            unsigned index = (*outDB)->mSymbolCount - 1;
-                            
-                            if(0 == strcmp((*outDB)->mSymbols[index].mName, symbol))
-                            {
-                                dbSymbol = &(*outDB)->mSymbols[index];
-                            }
-                        }
-                        
-                        /*
-                        **  May need to create symbol.
-                        */
-                        if(NULL == dbSymbol)
-                        {
-                            /*
-                            **  Could be time to grow the symbol pool.
-                            */
-                            if((*outDB)->mSymbolCount >= (*outDB)->mSymbolCapacity)
-                            {
-                                moved = realloc((*outDB)->mSymbols, sizeof(SymDB_Symbol) * ((*outDB)->mSymbolCapacity + SYMDB_SYMBOL_GROWBY));
-                                if(NULL != moved)
-                                {
-                                    (*outDB)->mSymbols = (SymDB_Symbol*)moved;
-                                    memset(&(*outDB)->mSymbols[(*outDB)->mSymbolCapacity], 0, sizeof(SymDB_Symbol) * SYMDB_SYMBOL_GROWBY);
-                                    (*outDB)->mSymbolCapacity += SYMDB_SYMBOL_GROWBY;
-                                }
-                                else
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, inDBName, "Unable to grow symbol DB symbol array.");
-                                    break;
-                                }
-                            }
-
-                            if((*outDB)->mSymbolCount < (*outDB)->mSymbolCapacity)
-                            {
-                                dbSymbol = &(*outDB)->mSymbols[(*outDB)->mSymbolCount];
-                                (*outDB)->mSymbolCount++;
-                                
-                                dbSymbol->mName = strdup(symbol);
-                                if(NULL == dbSymbol->mName)
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, symbol, "Unable to duplicate string.");
-                                    break;
-                                }
-                            }
-                            else
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, symbol, "Unable to grow symbol DB for symbol.");
-                                break;
-                            }
-                        }
-                        
-                        /*
-                        **  Assume we have the symbol.
-                        **
-                        **  Is this the same section as the last section in the symbol?
-                        **  This assumes the symdb was presorted!!!!
-                        */
-                        if(0 != dbSymbol->mSectionCount)
-                        {
-                            unsigned index = dbSymbol->mSectionCount - 1;
-                            
-                            if(0 == strcmp(dbSymbol->mSections[index].mName, section))
-                            {
-                                dbSection = &dbSymbol->mSections[index];
-                            }
-                        }
-                        
-                        /*
-                        **  May need to create the section.
-                        */
-                        if(NULL == dbSection)
-                        {
-                            moved = realloc(dbSymbol->mSections, sizeof(SymDB_Section) * (dbSymbol->mSectionCount + 1));
-                            if(NULL != moved)
-                            {
-                                dbSymbol->mSections = (SymDB_Section*)moved;
-                                dbSection = &dbSymbol->mSections[dbSymbol->mSectionCount];
-                                dbSymbol->mSectionCount++;
-                                
-                                memset(dbSection, 0, sizeof(SymDB_Section));
-                                
-                                dbSection->mName = strdup(section);
-                                if(NULL == dbSection->mName)
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, section, "Unable to duplicate string.");
-                                    break;
-                                }
-                            }
-                            else
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, section, "Unable to grow symbol sections for symbol DB.");
-                                break;
-                            }
-                        }
-                        
-                        /*
-                        **  Assume we have the section.
-                        **
-                        **  Is this the same size as the last size?
-                        **  This assumes the symdb was presorted!!!
-                        */
-                        if(0 != dbSection->mSizeCount)
-                        {
-                            unsigned index = dbSection->mSizeCount - 1;
-                            
-                            if(dbSection->mSizes[index].mSize == lengthNum)
-                            {
-                                dbSize = &dbSection->mSizes[index];
-                            }
-                        }
-                        
-                        /*
-                        **  May need to create the size in question.
-                        */
-                        if(NULL == dbSize)
-                        {
-                            moved = realloc(dbSection->mSizes, sizeof(SymDB_Size) * (dbSection->mSizeCount + 1));
-                            if(NULL != moved)
-                            {
-                                dbSection->mSizes = (SymDB_Size*)moved;
-                                dbSize = &dbSection->mSizes[dbSection->mSizeCount];
-                                dbSection->mSizeCount++;
-                                
-                                memset(dbSize, 0, sizeof(SymDB_Size));
-                                
-                                dbSize->mSize = lengthNum;
-                            }
-                            else
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, length, "Unable to grow symbol section sizes for symbol DB.");
-                                break;
-                            }
-                        }
-                        
-                        /*
-                        **  Assume we have the size.
-                        **
-                        **  We assume a one to one correllation between size and object.
-                        **  Always try to add the new object name.
-                        **  As the symdb is assumed to be sorted, the object names should also be in order.
-                        */
-                        moved = realloc(dbSize->mObjects, sizeof(char*) * (dbSize->mObjectCount + 1));
-                        if(NULL != moved)
-                        {
-                            dbObject = strdup(object);
-                            
-                            dbSize->mObjects = (char**)moved;
-                            dbSize->mObjects[dbSize->mObjectCount] = dbObject;
-                            dbSize->mObjectCount++;
-                            
-                            if(NULL == dbObject)
-                            {
-                                retval = __LINE__;
-                                ERROR_REPORT(retval, object, "Unable to duplicate string.");
-                                break;
-                            }
-                        }
-                        else
-                        {
-                            retval = __LINE__;
-                            ERROR_REPORT(retval, object, "Unable to grow symbol section size objects for symbol DB.");
-                            break;
-                        }
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, length, "Unable to convert symbol DB length into a number.");
-                        break;
-                    }
-                }
-            
-                if(0 == retval && 0 != ferror(symDB))
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, inDBName, "Unable to read file.");
-                }
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, inDBName, "Unable to allocate symbol DB.");
-            }
-
-            fclose(symDB);
-            symDB = NULL;
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, inDBName, "Unable to open symbol DB.");
-        }
-    }
-    else
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, "(NULL)", "Invalid arguments.");
-    }
-
-    return retval;
-}
-
-
-void cleanSymDB(SymDB_Container** inDB)
-/*
-**  Free it all up.
-*/
-{
-    if(NULL != inDB && NULL != *inDB)
-    {
-        unsigned symLoop = 0;
-        unsigned secLoop = 0;
-        unsigned sizLoop = 0;
-        unsigned objLoop = 0;
-
-        for(symLoop = 0; symLoop < (*inDB)->mSymbolCount; symLoop++)
-        {
-            for(secLoop = 0; secLoop < (*inDB)->mSymbols[symLoop].mSectionCount; secLoop++)
-            {
-                for(sizLoop = 0; sizLoop < (*inDB)->mSymbols[symLoop].mSections[secLoop].mSizeCount; sizLoop++)
-                {
-                    for(objLoop = 0; objLoop < (*inDB)->mSymbols[symLoop].mSections[secLoop].mSizes[sizLoop].mObjectCount; objLoop++)
-                    {
-                        CLEANUP((*inDB)->mSymbols[symLoop].mSections[secLoop].mSizes[sizLoop].mObjects[objLoop]);
-                    }
-                    CLEANUP((*inDB)->mSymbols[symLoop].mSections[secLoop].mSizes[sizLoop].mObjects);
-                }
-                CLEANUP((*inDB)->mSymbols[symLoop].mSections[secLoop].mName);
-                CLEANUP((*inDB)->mSymbols[symLoop].mSections[secLoop].mSizes);
-            }
-            CLEANUP((*inDB)->mSymbols[symLoop].mName);
-            CLEANUP((*inDB)->mSymbols[symLoop].mSections);
-        }
-        CLEANUP((*inDB)->mSymbols);
-        CLEANUP(*inDB);
-    }
-}
-
-
-int symDBLookup(const void* inKey, const void* inItem)
-/*
-**  bsearch utility routine to find the symbol in the symdb.
-*/
-{
-    int retval = 0;
-    const char* key = (const char*)inKey;
-    const SymDB_Symbol* symbol = (const SymDB_Symbol*)inItem;
-
-    retval = strcmp(key, symbol->mName);
-
-    return retval;
-}
-
-
-int fillSymbolSizeFromDB(Options* inOptions, MSMap_Module* inModule, MSMap_Symbol* inoutSymbol, const char* inMangledName)
-/*
-**  If we have a symbol DB, attempt to determine the real size of the symbol
-**      up front.
-**  This helps us later in the game to avoid performing size guesses by
-**      offset.
-*/
-{
-    int retval = 0;
-
-    /*
-    **  May need to initialize symdb.
-    */
-    if(NULL == inOptions->mSymDB && NULL != inOptions->mSymDBName)
-    {
-        retval = readSymDB(inOptions->mSymDBName, &inOptions->mSymDB);
-    }
-
-    /*
-    **  Optional
-    */
-    if(0 == retval && NULL != inOptions->mSymDB)
-    {
-        void* match = NULL;
-
-        /*
-        **  Find the symbol.
-        */
-        match = bsearch(inMangledName, inOptions->mSymDB->mSymbols, inOptions->mSymDB->mSymbolCount, sizeof(SymDB_Symbol), symDBLookup);
-        if(NULL != match)
-        {
-            SymDB_Symbol* symbol = (SymDB_Symbol*)match;
-            unsigned symDBSize = 0;
-            MSMap_Segment* mapSection = NULL;
-
-            /*
-            **  We found the symbol.
-            **
-            **  See if it has the section in question.
-            */
-            mapSection = getSymbolSection(inModule, inoutSymbol);
-            if(NULL != mapSection)
-            {
-                unsigned secLoop = 0;
-
-                for(secLoop = 0; secLoop < symbol->mSectionCount; secLoop++)
-                {
-                    if(0 == strcmp(mapSection->mSegment, symbol->mSections[secLoop].mName))
-                    {
-                        SymDB_Section* section = &symbol->mSections[secLoop];
-
-                        /*
-                        **  We have a section match.
-                        **  Should there be a single size for the symbol,
-                        **      then we just default to that.
-                        **  If more than one size, we have to do an
-                        **      object match search.
-                        **  Should there be no object match, we do nothign.
-                        */
-                        if(1 == section->mSizeCount)
-                        {
-                            symDBSize = section->mSizes[0].mSize;
-                        }
-                        else
-                        {
-                            char* mapObject = NULL;
-                            
-                            /*
-                            **  Figure out the map object file name.
-                            **  Skip any colon.
-                            **  If it doesn't have a .obj in it, not worth continuing.
-                            */
-                            mapObject = strrchr(inoutSymbol->mObject, ':');
-                            if(NULL == mapObject)
-                            {
-                                mapObject = inoutSymbol->mObject;
-                            }
-                            else
-                            {
-                                mapObject++; /* colon */
-                            }
-
-                            if(NULL != strstr(mapObject, ".obj"))
-                            {
-                                unsigned sizLoop = 0;
-                                unsigned objLoop = 0;
-                                SymDB_Size* size = NULL;
-
-                                for(sizLoop = 0; sizLoop < section->mSizeCount; sizLoop++)
-                                {
-                                    size = &section->mSizes[sizLoop];
-                                    
-                                    for(objLoop = 0; objLoop < size->mObjectCount; objLoop++)
-                                    {
-                                        if(NULL != strstr(size->mObjects[objLoop], mapObject))
-                                        {
-                                            /*
-                                            **  As we matched the object, in a particular section,
-                                            **      we'll go with this as the number.
-                                            */
-                                            symDBSize = size->mSize;
-                                            break;
-                                        }
-                                    }
-                                    
-                                    /*
-                                    **  If the object loop broke early, we break too.
-                                    */
-                                    if(objLoop < size->mObjectCount)
-                                    {
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-
-                        break;
-                    }
-                }
-            }
-
-            /*
-            **  Put the size in.
-            */
-            inoutSymbol->mSymDBSize = symDBSize;
-        }
-    }
-
-    return retval;
-}
-
-
-char* symdup(const char* inSymbol)
-/*
-**  Attempts to demangle the symbol if appropriate.
-**  Otherwise acts like strdup.
-*/
-{
-    char* retval = NULL;
-
-#if F_DEMANGLE
-    {
-        int isImport = 0;
-
-        if(0 == strncmp("__imp_", inSymbol, 6))
-        {
-            isImport = __LINE__;
-            inSymbol += 6;
-        }
-
-        if('?' == inSymbol[0])
-        {
-            char demangleBuf[0x200];
-            DWORD demangleRes = 0;
-            
-            demangleRes = UnDecorateSymbolName(inSymbol, demangleBuf, sizeof(demangleBuf), UNDNAME_COMPLETE);
-            if(0 != demangleRes)
-            {
-                if (strcmp(demangleBuf, "`string'") == 0)
-                {
-                    
-                    /* attempt manual demangling of string prefix.. */
-
-                    /* first make sure we have enough space for the
-                       updated string - the demangled string will
-                       always be shorter than strlen(inSymbol) and the
-                       prologue will always be longer than the
-                       "string: " that we tack on the front of the string
-                    */
-                    char *curresult = retval = malloc(strlen(inSymbol) + 11);
-                    const char *curchar = inSymbol;
-                    
-                    int state = DEMANGLE_STATE_START;
-
-                    /* the hex state is for stuff like ?$EA which
-                       really means hex value 0x40 */
-                    char hex_state = 0;
-                    char string_is_unicode = 0;
-
-                    /* sometimes we get a null-termination before the
-                       final @ sign - in that case, remember that
-                       we've seen the whole string */
-                    int have_null_char = 0;
-
-                    /* stick our user-readable prefix on */
-                    strcpy(curresult, "string: \"");
-                    curresult += 9;
-                    
-                    while (*curchar) {
-                        
-                        // process current state
-                        switch (state) {
-
-                            /* the Prologue states are divided up so
-                               that someday we can try to decode
-                               the random letters in between the '@'
-                               signs. Also, some strings only have 2
-                               prologue '@' signs, so we have to
-                               figure out how to distinguish between
-                               them at some point. */
-                        case DEMANGLE_STATE_START:
-                            if (*curchar == '@')
-                                state = DEMANGLE_STATE_PROLOGUE_1;
-                            /* ignore all other states */
-                            break;
-
-                        case DEMANGLE_STATE_PROLOGUE_1:
-                            switch (*curchar) {
-                            case '0':
-                                string_is_unicode=0;
-                                state = DEMANGLE_STATE_HAVE_TYPE;
-                                break;
-                            case '1':
-                                string_is_unicode=1;
-                                state = DEMANGLE_STATE_HAVE_TYPE;
-                                break;
-
-                                /* ignore all other characters */
-                            }
-                            break;
-
-                        case DEMANGLE_STATE_HAVE_TYPE:
-                            if (*curchar >= '0' && *curchar <= '9') {
-                                state = DEMANGLE_STATE_DEC_LENGTH;
-                            } else if (*curchar >= 'A' && *curchar <= 'Z') {
-                                state = DEMANGLE_STATE_HEX_LENGTH;
-                            }
-                        case DEMANGLE_STATE_DEC_LENGTH:
-                            /* decimal lengths don't have the 2nd
-                               field
-                            */
-                            if (*curchar == '@')
-                                state = DEMANGLE_STATE_NORMAL;
-                            break;
-                            
-                        case DEMANGLE_STATE_HEX_LENGTH:
-                            /* hex lengths have a 2nd field
-                               (though I have no idea what it is for)
-                            */
-                            if (*curchar == '@')
-                                state = DEMANGLE_STATE_PROLOGUE_SECONDARY;
-                            break;
-
-                        case DEMANGLE_STATE_PROLOGUE_SECONDARY:
-                            if (*curchar == '@')
-                                state = DEMANGLE_STATE_NORMAL;
-                            break;
-                        
-                        case DEMANGLE_STATE_NORMAL:
-                            switch (*curchar) {
-                            case '?':
-                                state = DEMANGLE_STATE_QDECODE;
-                                break;
-                            case '@':
-                                state = DEMANGLE_STATE_STOP;
-                                break;
-                            default:
-                                *curresult++ = DEMANGLE_SAFE_CHAR(*curchar);
-                                state = DEMANGLE_STATE_NORMAL;
-                                break;
-                            }
-                            break;
-
-                            /* found a '?' */
-                        case DEMANGLE_STATE_QDECODE:
-                            state = DEMANGLE_STATE_NORMAL;
-
-                            /* there are certain shortcuts, like
-                               "?3" means ":"
-                            */
-                            switch (*curchar) {
-                            case '1':
-                                *curresult++ = '/';
-                                break;
-                            case '2':
-                                *curresult++ = '\\';
-                                break;
-                            case '3':
-                                *curresult++ = ':';
-                                break;
-                            case '4':
-                                *curresult++ = '.';
-                                break;
-                            case '5':
-                                *curresult++ = ' ';
-                                break;
-                            case '6':
-                                *curresult++ = '\\';
-                                *curresult++ = 'n';
-                                break;
-                            case '8':
-                                *curresult++ = '\'';
-                                break;
-                            case '9':
-                                *curresult++ = '-';
-                                break;
-
-                                /* any other arbitrary ASCII value can
-                                   be stored by prefixing it with ?$
-                                */
-                            case '$':
-                                state = DEMANGLE_STATE_DOLLAR_1;
-                            }
-                            break;
-                            
-                        case DEMANGLE_STATE_DOLLAR_1:
-                            /* first digit of ?$ notation. All digits
-                               are hex, represented starting with the
-                               capital leter 'A' such that 'A' means 0x0,
-                               'B' means 0x1, 'K' means 0xA
-                            */
-                            hex_state = (*curchar - 'A') * 0x10;
-                            state = DEMANGLE_STATE_DOLLAR_2;
-                            break;
-
-                        case DEMANGLE_STATE_DOLLAR_2:
-                            /* same mechanism as above */
-                            hex_state += (*curchar - 'A');
-                            if (hex_state) {
-                                *curresult++ = DEMANGLE_SAFE_CHAR(hex_state);
-                                have_null_char = 0;
-                            }
-                            else {
-                                have_null_char = 1;
-                            }
-                            
-                            state = DEMANGLE_STATE_NORMAL;
-                            break;
-
-                        case DEMANGLE_STATE_STOP:
-                            break;
-                        }
-
-                        curchar++;
-                    }
-                    
-                    /* add the appropriate termination depending
-                       if we completed the string or not */
-                    if (!have_null_char)
-                        strcpy(curresult, "...\"");
-                    else
-                        strcpy(curresult, "\"");
-                } else {
-                    retval = strdup(demangleBuf);
-                }
-            }
-            else
-            {
-                /*
-                ** fall back to normal.
-                */
-                retval = strdup(inSymbol);
-            }
-        }
-        else if('_' == inSymbol[0])
-        {
-            retval = strdup(inSymbol + 1);
-        }
-        else
-        {
-            retval = strdup(inSymbol);
-        }
-
-        /*
-        **  May need to rewrite the symbol if an import.
-        */
-        if(NULL != retval && isImport)
-        {
-            const char importPrefix[] = "__declspec(dllimport) ";
-            char importBuf[0x200];
-            int printRes = 0;
-
-            printRes = _snprintf(importBuf, sizeof(importBuf), "%s%s", importPrefix, retval);
-            free(retval);
-            retval = NULL;
-
-            if(printRes > 0)
-            {
-                retval = strdup(importBuf);
-            }
-        }
-    }
-#else /* F_DEMANGLE */
-    retval = strdup(inSymbol);
-#endif  /* F_DEMANGLE */
-
-    return retval;
-}
-
-
-int readmap(Options* inOptions, MSMap_Module* inModule)
-/*
-**  Read the input line by line, adding it to the module.
-*/
-{
-    int retval = 0;
-    char lineBuffer[0x400];
-    char* current = NULL;
-    MSMap_ReadState fsm;
-    int len = 0;
-    int forceContinue = 0;
-    
-    memset(&fsm, 0, sizeof(fsm));
-    
-    /*
-    **  Read the map file line by line.
-    **  We keep a simple state machine to determine what we're looking at.
-    */
-    while(0 == retval && NULL != fgets(lineBuffer, sizeof(lineBuffer), inOptions->mInput))
-    {
-        if(forceContinue)
-        {
-            /*
-            **  Used to skip anticipated blank lines.
-            */
-            forceContinue--;
-            continue;
-        }
-
-        current = skipWhite(lineBuffer);
-        trimWhite(current);
-        
-        len = strlen(current);
-        
-        if(fsm.mHasModule)
-        {
-            if(fsm.mHasTimestamp)
-            {
-                if(fsm.mHasPreferredLoadAddress)
-                {
-                    if(fsm.mHasSegmentData)
-                    {
-                        if(fsm.mHasPublicSymbolData)
-                        {
-                            if(fsm.mHasEntryPoint)
-                            {
-                                if(fsm.mFoundStaticSymbols)
-                                {
-                                    /*
-                                    **  A blank line means we've reached the end of all static symbols.
-                                    */
-                                    if(len)
-                                    {
-                                       /*
-                                        **  We're adding a new symbol.
-                                        **  Make sure we have room for it.
-                                        */
-                                        if(inModule->mSymbolCapacity == inModule->mSymbolCount)
-                                        {
-                                            void* moved = NULL;
-                                            
-                                            moved = realloc(inModule->mSymbols, sizeof(MSMap_Symbol) * (inModule->mSymbolCapacity + MSMAP_SYMBOL_GROWBY));
-                                            if(NULL != moved)
-                                            {
-                                                inModule->mSymbolCapacity += MSMAP_SYMBOL_GROWBY;
-                                                inModule->mSymbols = (MSMap_Symbol*)moved;
-                                            }
-                                            else
-                                            {
-                                                retval = __LINE__;
-                                                ERROR_REPORT(retval, inModule->mModule, "Unable to grow symbols.");
-                                            }
-                                        }
-                                        
-                                        if(0 == retval && inModule->mSymbolCapacity > inModule->mSymbolCount)
-                                        {
-                                            MSMap_Symbol* theSymbol = NULL;
-                                            unsigned index = 0;
-                                            int scanRes = 0;
-                                            char symbolBuf[SYMBOL_BUF_CHARS + 1];
-                                            
-                                            index = inModule->mSymbolCount;
-                                            inModule->mSymbolCount++;
-                                            theSymbol = (inModule->mSymbols + index);
-                                            
-                                            memset(theSymbol, 0, sizeof(MSMap_Symbol));
-                                            theSymbol->mScope = STATIC;
-                                            
-                                            scanRes = sscanf(current, "%x:%x %" STRINGIFY(SYMBOL_BUF_CHARS) "s %x", (unsigned*)&(theSymbol->mPrefix), (unsigned*)&(theSymbol->mOffset), symbolBuf, (unsigned*)&(theSymbol->mRVABase));
-                                            if(4 == scanRes)
-                                            {
-                                                theSymbol->mSymbol = symdup(symbolBuf);
-
-                                                if(0 == retval)
-                                                {
-                                                    if(NULL != theSymbol->mSymbol)
-                                                    {
-                                                        char *last = lastWord(current);
-                                                        
-                                                        theSymbol->mObject = strdup(last);
-                                                        if(NULL == theSymbol->mObject)
-                                                        {
-                                                            retval = __LINE__;
-                                                            ERROR_REPORT(retval, last, "Unable to copy object name.");
-                                                        }
-                                                    }
-                                                    else
-                                                    {
-                                                        retval = __LINE__;
-                                                        ERROR_REPORT(retval, symbolBuf, "Unable to copy symbol name.");
-                                                    }
-                                                }
-                                            }
-                                            else
-                                            {
-                                                retval = __LINE__;
-                                                ERROR_REPORT(retval, inModule->mModule, "Unable to scan static symbols.");
-                                            }
-                                        }
-                                    }
-                                    else
-                                    {
-                                        /*
-                                        **  All done.
-                                        */
-                                        break;
-                                    }
-                                }
-                                else
-                                {
-                                    /*
-                                    **  Static symbols are optional.
-                                    **  If no static symbols we're done.
-                                    **  Otherwise, set the flag such that it will work more.
-                                    */
-                                    if(0 == strcmp(current, "Static symbols"))
-                                    {
-                                        fsm.mFoundStaticSymbols = __LINE__;
-                                        forceContinue = 1;
-                                    }
-                                    else
-                                    {
-                                        /*
-                                        **  All done.
-                                        */
-                                        break;
-                                    }
-                                }
-                            }
-                            else
-                            {
-                                int scanRes = 0;
-                                
-                                scanRes = sscanf(current, "entry point at %x:%x", (unsigned*)&(inModule->mEntryPrefix), (unsigned*)&(inModule->mEntryOffset));
-                                if(2 == scanRes)
-                                {
-                                    fsm.mHasEntryPoint = __LINE__;
-                                    forceContinue = 1;
-                                }
-                                else
-                                {
-                                    retval = __LINE__;
-                                    ERROR_REPORT(retval, current, "Unable to obtain entry point.");
-                                }
-                            }
-                        }
-                        else
-                        {
-                            /*
-                            **  Skip the N lines of public symbol data (column headers).
-                            */
-                            if(2 <= fsm.mHasPublicSymbolDataSkippedLines)
-                            {
-                                /*
-                                **  A blank line indicates end of public symbols. 
-                                */
-                                if(len)
-                                {
-                                    /*
-                                    **  We're adding a new symbol.
-                                    **  Make sure we have room for it.
-                                    */
-                                    if(inModule->mSymbolCapacity == inModule->mSymbolCount)
-                                    {
-                                        void* moved = NULL;
-                                        
-                                        moved = realloc(inModule->mSymbols, sizeof(MSMap_Symbol) * (inModule->mSymbolCapacity + MSMAP_SYMBOL_GROWBY));
-                                        if(NULL != moved)
-                                        {
-                                            inModule->mSymbolCapacity += MSMAP_SYMBOL_GROWBY;
-                                            inModule->mSymbols = (MSMap_Symbol*)moved;
-                                        }
-                                        else
-                                        {
-                                            retval = __LINE__;
-                                            ERROR_REPORT(retval, inModule->mModule, "Unable to grow symbols.");
-                                        }
-                                    }
-                                    
-                                    if(0 == retval && inModule->mSymbolCapacity > inModule->mSymbolCount)
-                                    {
-                                        MSMap_Symbol* theSymbol = NULL;
-                                        unsigned index = 0;
-                                        int scanRes = 0;
-                                        char symbolBuf[SYMBOL_BUF_CHARS + 1];
-                                        
-                                        index = inModule->mSymbolCount;
-                                        inModule->mSymbolCount++;
-                                        theSymbol = (inModule->mSymbols + index);
-                                        
-                                        memset(theSymbol, 0, sizeof(MSMap_Symbol));
-                                        theSymbol->mScope = PUBLIC;
-                                        
-                                        scanRes = sscanf(current, "%x:%x %" STRINGIFY(SYMBOL_BUF_CHARS) "s %x", (unsigned*)&(theSymbol->mPrefix), (unsigned*)&(theSymbol->mOffset), symbolBuf, (unsigned *)&(theSymbol->mRVABase));
-                                        if(4 == scanRes)
-                                        {
-                                            theSymbol->mSymbol = symdup(symbolBuf);
-
-                                            if(NULL != theSymbol->mSymbol)
-                                            {
-                                                char *last = lastWord(current);
-                                                
-                                                theSymbol->mObject = strdup(last);
-                                                if(NULL != theSymbol->mObject)
-                                                {
-                                                    /*
-                                                    **  Finally, attempt to lookup the actual size of the symbol
-                                                    **      if there is a symbol DB available.
-                                                    */
-                                                    retval = fillSymbolSizeFromDB(inOptions, inModule, theSymbol, symbolBuf);
-                                                }
-                                                else
-                                                {
-                                                    retval = __LINE__;
-                                                    ERROR_REPORT(retval, last, "Unable to copy object name.");
-                                                }
-                                            }
-                                            else
-                                            {
-                                                retval = __LINE__;
-                                                ERROR_REPORT(retval, symbolBuf, "Unable to copy symbol name.");
-                                            }
-                                        }
-                                        else
-                                        {
-                                            retval = __LINE__;
-                                            ERROR_REPORT(retval, inModule->mModule, "Unable to scan public symbols.");
-                                        }
-                                    }
-                                }
-                                else
-                                {
-                                    fsm.mHasPublicSymbolData = __LINE__;
-                                }
-                            }
-                            else
-                            {
-                                fsm.mHasPublicSymbolDataSkippedLines++;
-                            }
-                        }
-                    }
-                    else
-                    {
-                        /*
-                        **  Skip the first line of segment data (column headers).
-                        **  Mark that we've begun grabbing segement data.
-                        */
-                        if(fsm.mSegmentDataSkippedLine)
-                        {
-                            /*
-                            **  A blank line means end of the segment data.
-                            */
-                            if(len)
-                            {
-                                /*
-                                **  We're adding a new segment.
-                                **  Make sure we have room for it.
-                                */
-                                if(inModule->mSegmentCapacity == inModule->mSegmentCount)
-                                {
-                                    void* moved = NULL;
-                                    
-                                    moved = realloc(inModule->mSegments, sizeof(MSMap_Segment) * (inModule->mSegmentCapacity + MSMAP_SEGMENT_GROWBY));
-                                    if(NULL != moved)
-                                    {
-                                        inModule->mSegmentCapacity += MSMAP_SEGMENT_GROWBY;
-                                        inModule->mSegments = (MSMap_Segment*)moved;
-                                    }
-                                    else
-                                    {
-                                        retval = __LINE__;
-                                        ERROR_REPORT(retval, inModule->mModule, "Unable to grow segments.");
-                                    }
-                                }
-                                
-                                if(0 == retval && inModule->mSegmentCapacity > inModule->mSegmentCount)
-                                {
-                                    MSMap_Segment* theSegment = NULL;
-                                    unsigned index = 0;
-                                    #define CLASS_BUF_CHARS 15
-                                    char classBuf[CLASS_BUF_CHARS + 1];
-                                    #define NAME_BUF_CHARS 31
-                                    char nameBuf[NAME_BUF_CHARS + 1];
-                                    int scanRes = 0;
-                                    
-                                    index = inModule->mSegmentCount;
-                                    inModule->mSegmentCount++;
-                                    theSegment = (inModule->mSegments + index);
-                                    
-                                    memset(theSegment, 0, sizeof(MSMap_Segment));
-                                    
-                                    scanRes = sscanf(current, "%x:%x %xH %" STRINGIFY(NAME_BUF_CHARS) "s %" STRINGIFY(CLASS_BUF_CHARS) "s", (unsigned*)&(theSegment->mPrefix), (unsigned*)&(theSegment->mOffset), (unsigned*)&(theSegment->mLength), nameBuf, classBuf);
-                                    if(5 == scanRes)
-                                    {
-                                        if('.' == nameBuf[0])
-                                        {
-                                            theSegment->mSegment = strdup(&nameBuf[1]);
-                                        }
-                                        else
-                                        {
-                                            theSegment->mSegment = strdup(nameBuf);
-                                        }
-
-                                        if(NULL != theSegment->mSegment)
-                                        {
-                                            if(0 == strcmp("DATA", classBuf))
-                                            {
-                                                theSegment->mClass = DATA;
-                                            }
-                                            else if(0 == strcmp("CODE", classBuf))
-                                            {
-                                                theSegment->mClass = CODE;
-                                            }
-                                            else
-                                            {
-                                                retval = __LINE__;
-                                                ERROR_REPORT(retval, classBuf, "Unrecognized segment class.");
-                                            }
-                                        }
-                                        else
-                                        {
-                                            retval = __LINE__;
-                                            ERROR_REPORT(retval, nameBuf, "Unable to copy segment name.");
-                                        }
-                                    }
-                                    else
-                                    {
-                                        retval = __LINE__;
-                                        ERROR_REPORT(retval, inModule->mModule, "Unable to scan segments.");
-                                    }
-                                }
-                            }
-                            else
-                            {
-                                fsm.mHasSegmentData = __LINE__;
-                            }
-                        }
-                        else
-                        {
-                            fsm.mSegmentDataSkippedLine = __LINE__;
-                        }
-                    }
-                }
-                else
-                {
-                    int scanRes = 0;
-                    
-                    /*
-                    **  The PLA has a particular format.
-                    */
-                    scanRes = sscanf(current, "Preferred load address is %x", (unsigned*)&(inModule->mPreferredLoadAddress));
-                    if(1 == scanRes)
-                    {
-                        fsm.mHasPreferredLoadAddress = __LINE__;
-                        forceContinue = 1;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current, "Unable to obtain preferred load address.");
-                    }
-                }
-            }
-            else
-            {
-                int scanRes = 0;
-                
-                /*
-                **  The timestamp has a particular format.
-                */
-                scanRes = sscanf(current, "Timestamp is %x", (unsigned*)&(inModule->mTimestamp));
-                if(1 == scanRes)
-                {
-                    fsm.mHasTimestamp = __LINE__;
-                    forceContinue = 1;
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current, "Unable to obtain timestamp.");
-                }
-            }
-        }
-        else
-        {
-            /*
-            **  The module is on a line by itself.
-            */
-            inModule->mModule = strdup(current);
-            if(NULL != inModule->mModule)
-            {
-                fsm.mHasModule = __LINE__;
-                forceContinue = 1;
-
-                if(0 != inOptions->mMatchModuleCount)
-                {
-                    unsigned matchLoop = 0;
-                    
-                    /*
-                    **  If this module name doesn't match, then bail.
-                    **  Compare in a case sensitive manner, exact match only.
-                    */
-                    for(matchLoop = 0; matchLoop < inOptions->mMatchModuleCount; matchLoop++)
-                    {
-                        if(0 == strcmp(inModule->mModule, inOptions->mMatchModules[matchLoop]))
-                        {
-                            break;
-                        }
-                    }
-                    
-                    if(matchLoop == inOptions->mMatchModuleCount)
-                    {
-                        /*
-                        **  A match did not occur, bail out of read loop.
-                        **  No error, however.
-                        */
-                        break;
-                    }
-                }
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, current, "Unable to obtain module.");
-            }
-        }
-    }
-    
-    if(0 == retval && 0 != ferror(inOptions->mInput))
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, inOptions->mInputName, "Unable to read file.");
-    }
-    
-    return retval;
-}
-
-
-static int qsortRVABase(const void* in1, const void* in2)
-/*
-**  qsort callback to sort the symbols by their RVABase.
-*/
-{
-    MSMap_Symbol* sym1 = (MSMap_Symbol*)in1;
-    MSMap_Symbol* sym2 = (MSMap_Symbol*)in2;
-    int retval = 0;
-
-    if(sym1->mRVABase < sym2->mRVABase)
-    {
-        retval = -1;
-    }
-    else if(sym1->mRVABase > sym2->mRVABase)
-    {
-        retval = 1;
-    }
-
-    return retval;
-}
-
-
-static int tsvout(Options* inOptions, unsigned inSize, MSMap_SegmentClass inClass, MSMap_SymbolScope inScope, const char* inModule, const char* inSegment, const char* inObject, const char* inSymbol)
-/*
-**  Output a line of map information separated by tabs.
-**  Some items (const char*), if not present, will receive a default value.
-*/
-{
-    int retval = 0;
-
-    /*
-    **  No need to output on no size.
-    **  This can happen with zero sized segments,
-    **      or an imported symbol which has multiple names (one will count).
-    */
-    if(0 != inSize)
-    {
-        char objectBuf[0x100];
-        const char* symScope = NULL;
-        const char* segClass = NULL;
-        const char* undefined = "UNDEF";
-        
-        /*
-        **  Fill in unspecified values.
-        */
-        if(NULL == inObject)
-        {
-            sprintf(objectBuf, "%s:%s:%s", undefined, inModule, inSegment);
-            inObject = objectBuf;
-        }
-        if(NULL == inSymbol)
-        {
-            inSymbol = inObject;
-        }
-        
-        /*
-        **  Convert some enumerations to text.
-        */
-        switch(inClass)
-        {
-        case CODE:
-            segClass = "CODE";
-            break;
-        case DATA:
-            segClass = "DATA";
-            break;
-        default:
-            retval = __LINE__;
-            ERROR_REPORT(retval, "", "Unable to determine class for output.");
-            break;
-        }
-        
-        switch(inScope)
-        {
-        case PUBLIC:
-            symScope = "PUBLIC";
-            break;
-        case STATIC:
-            symScope = "STATIC";
-            break;
-        case UNDEFINED:
-            symScope = undefined;
-            break;
-        default:
-            retval = __LINE__;
-            ERROR_REPORT(retval, "", "Unable to determine scope for symbol.");
-            break;
-        }
-        
-        if(0 == retval)
-        {
-            int printRes = 0;
-            
-            printRes = fprintf(inOptions->mOutput,
-                "%.8X\t%s\t%s\t%s\t%s\t%s\t%s\n",
-                inSize,
-                segClass,
-                symScope,
-                inModule,
-                inSegment,
-                inObject,
-                inSymbol
-                );
-
-            if(0 > printRes)
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, inOptions->mOutputName, "Unable to output tsv data.");
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-void cleanModule(MSMap_Module* inModule)
-{
-    unsigned loop = 0;
-
-    for(loop = 0; loop < inModule->mSymbolCount; loop++)
-    {
-        CLEANUP(inModule->mSymbols[loop].mObject);
-        CLEANUP(inModule->mSymbols[loop].mSymbol);
-    }
-    CLEANUP(inModule->mSymbols);
-
-    for(loop = 0; loop < inModule->mSegmentCount; loop++)
-    {
-        CLEANUP(inModule->mSegments[loop].mSegment);
-    }
-    CLEANUP(inModule->mSegments);
-
-    CLEANUP(inModule->mModule);
-
-    memset(inModule, 0, sizeof(MSMap_Module));
-}
-
-
-int map2tsv(Options* inOptions)
-/*
-**  Read all input.
-**  Output tab separated value data.
-*/
-{
-    int retval = 0;
-    MSMap_Module module;
-
-    memset(&module, 0, sizeof(module));
-
-    /*
-    **  Read in the map file.
-    */
-    retval = readmap(inOptions, &module);
-    if(0 == retval)
-    {
-        unsigned symLoop = 0;
-        MSMap_Symbol* symbol = NULL;
-        unsigned secLoop = 0;
-        MSMap_Segment* section = NULL;
-        unsigned size = 0;
-        unsigned dbSize = 0;
-        unsigned offsetSize = 0;
-        unsigned endOffset = 0;
-
-        /*
-        **  Quick sort the symbols via RVABase.
-        */
-        qsort(module.mSymbols, module.mSymbolCount, sizeof(MSMap_Symbol), qsortRVABase);
-
-        /*
-        **  Go through all the symbols (in order by sort).
-        **  Output their sizes.
-        */
-        for(symLoop = 0; 0 == retval && symLoop < module.mSymbolCount; symLoop++)
-        {
-            symbol = &module.mSymbols[symLoop];
-            section = getSymbolSection(&module, symbol);
-            if (!section)
-                continue;
-
-            /*
-            **  Use the symbol DB size if available.
-            */
-            dbSize = symbol->mSymDBSize;
-
-            /*
-            **  Guess using offsets.
-            **  Is there a next symbol available?  If so, its start offset is the end of this symbol.
-            **  Otherwise, our section offset + length is the end of this symbol.
-            **
-            **  The trick is, the DB size can not go beyond the offset size, for sanity.
-            */
-            
-            /*
-            **  Try next symbol, but only if in same section.
-            **  If still not, use the end of the segment.
-            **  This implies we were the last symbol in the segment.
-            */
-            if((symLoop + 1) < module.mSymbolCount)
-            {
-                MSMap_Symbol* nextSymbol = NULL;
-                MSMap_Segment* nextSection = NULL;
-                
-                nextSymbol = &module.mSymbols[symLoop + 1];
-                nextSection = getSymbolSection(&module, nextSymbol);
-                
-                if(section == nextSection)
-                {
-                    endOffset = nextSymbol->mOffset;
-                }
-                else
-                {
-                    endOffset = section->mOffset + section->mLength;
-                }
-            }
-            else
-            {
-                endOffset = section->mOffset + section->mLength;
-            }
-
-            /*
-            **  Can now guess at size.
-            */
-            offsetSize = endOffset - symbol->mOffset;
-
-            /*
-            **  Now, determine which size to use.
-            **  This is really a sanity check as well.
-            */
-            size = offsetSize;
-            if(0 != dbSize)
-            {
-                if(dbSize < offsetSize)
-                {
-                    size = dbSize;
-                }
-            }
-
-            /*
-            **  Output the symbol with the size.
-            */
-            retval = tsvout(inOptions,
-                size,
-                section->mClass,
-                symbol->mScope,
-                module.mModule,
-                section->mSegment,
-                symbol->mObject,
-                symbol->mSymbol
-                );
-
-            /*
-            **  Make sure we mark this amount of space as used in the section.
-            */
-            section->mUsed += size;
-        }
-
-        /*
-        **  Go through the sections, and those whose length is longer than the
-        **      amount of space used, output dummy filler values.
-        */
-        for(secLoop = 0; 0 == retval && secLoop < module.mSegmentCount; secLoop++)
-        {
-            section = &module.mSegments[secLoop];
-
-            if(section && section->mUsed < section->mLength)
-            {
-                retval = tsvout(inOptions,
-                    section->mLength - section->mUsed,
-                    section->mClass,
-                    UNDEFINED,
-                    module.mModule,
-                    section->mSegment,
-                    NULL,
-                    NULL
-                    );
-            }
-        }
-    }
-
-    /*
-    **  Cleanup.
-    */
-    cleanModule(&module);
-
-    return retval;
-}
-
-
-int initOptions(Options* outOptions, int inArgc, char** inArgv)
-/*
-**  returns int     0 if successful.
-*/
-{
-    int retval = 0;
-    int loop = 0;
-    int switchLoop = 0;
-    int match = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    Switch* current = NULL;
-
-    /*
-    **  Set any defaults.
-    */
-    memset(outOptions, 0, sizeof(Options));
-    outOptions->mProgramName = inArgv[0];
-    outOptions->mInput = stdin;
-    outOptions->mInputName = strdup("stdin");
-    outOptions->mOutput = stdout;
-    outOptions->mOutputName = strdup("stdout");
-
-    if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName)
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup.");
-    }
-
-    /*
-    **  Go through and attempt to do the right thing.
-    */
-    for(loop = 1; loop < inArgc && 0 == retval; loop++)
-    {
-        match = 0;
-        current = NULL;
-
-        for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++)
-        {
-            if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-            else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-
-            if(match)
-            {
-                if(gSwitches[switchLoop]->mHasValue)
-                {
-                    /*
-                    **  Attempt to absorb next option to fullfill value.
-                    */
-                    if(loop + 1 < inArgc)
-                    {
-                        loop++;
-
-                        current = gSwitches[switchLoop];
-                        current->mValue = inArgv[loop];
-                    }
-                }
-                else
-                {
-                    current = gSwitches[switchLoop];
-                }
-
-                break;
-            }
-        }
-
-        if(0 == match)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch.");
-        }
-        else if(NULL == current)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value.");
-        }
-        else
-        {
-            /*
-            ** Do something based on address/swtich.
-            */
-            if(current == &gInputSwitch)
-            {
-                CLEANUP(outOptions->mInputName);
-                if(NULL != outOptions->mInput && stdin != outOptions->mInput)
-                {
-                    fclose(outOptions->mInput);
-                    outOptions->mInput = NULL;
-                }
-
-                outOptions->mInput = fopen(current->mValue, "r");
-                if(NULL == outOptions->mInput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open input file.");
-                }
-                else
-                {
-                    outOptions->mInputName = strdup(current->mValue);
-                    if(NULL == outOptions->mInputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gOutputSwitch)
-            {
-                CLEANUP(outOptions->mOutputName);
-                if(NULL != outOptions->mOutput && stdout != outOptions->mOutput)
-                {
-                    fclose(outOptions->mOutput);
-                    outOptions->mOutput = NULL;
-                }
-
-                outOptions->mOutput = fopen(current->mValue, "a");
-                if(NULL == outOptions->mOutput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open output file.");
-                }
-                else
-                {
-                    outOptions->mOutputName = strdup(current->mValue);
-                    if(NULL == outOptions->mOutputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gHelpSwitch)
-            {
-                outOptions->mHelp = __LINE__;
-            }
-            else if(current == &gMatchModuleSwitch)
-            {
-                void* moved = NULL;
-
-                /*
-                **  Add the value to the list of allowed module names.
-                */
-                moved = realloc(outOptions->mMatchModules, sizeof(char*) * (outOptions->mMatchModuleCount + 1));
-                if(NULL != moved)
-                {
-                    outOptions->mMatchModules = (char**)moved;
-                    outOptions->mMatchModules[outOptions->mMatchModuleCount] = strdup(current->mValue);
-                    if(NULL != outOptions->mMatchModules[outOptions->mMatchModuleCount])
-                    {
-                        outOptions->mMatchModuleCount++;
-                    }
-                    else
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to duplicate string.");
-                    }
-                }
-                else
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to allocate space for string.");
-                }
-            }
-            else if(current == &gSymDBSwitch)
-            {
-                CLEANUP(outOptions->mSymDBName);
-                outOptions->mSymDBName = strdup(current->mValue);
-                if(NULL == outOptions->mSymDBName)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to duplicate symbol db name.");
-                }
-            }
-            else if(current == &gBatchModeSwitch)
-            {
-                outOptions->mBatchMode = __LINE__;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, current->mLongName, "No handler for command line switch.");
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-void cleanOptions(Options* inOptions)
-/*
-**  Clean up any open handles, et. al.
-*/
-{
-    CLEANUP(inOptions->mInputName);
-    if(NULL != inOptions->mInput && stdin != inOptions->mInput)
-    {
-        fclose(inOptions->mInput);
-    }
-    CLEANUP(inOptions->mOutputName);
-    if(NULL != inOptions->mOutput && stdout != inOptions->mOutput)
-    {
-        fclose(inOptions->mOutput);
-    }
-    while(0 != inOptions->mMatchModuleCount)
-    {
-        inOptions->mMatchModuleCount--;
-        CLEANUP(inOptions->mMatchModules[inOptions->mMatchModuleCount]);
-    }
-    CLEANUP(inOptions->mMatchModules);
-
-    cleanSymDB(&inOptions->mSymDB);
-
-    memset(inOptions, 0, sizeof(Options));
-}
-
-
-void showHelp(Options* inOptions)
-/*
-**  Show some simple help text on usage.
-*/
-{
-    int loop = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    const char* valueText = NULL;
-
-    printf("usage:\t%s [arguments]\n", inOptions->mProgramName);
-    printf("\n");
-    printf("arguments:\n");
-
-    for(loop = 0; loop < switchCount; loop++)
-    {
-        if(gSwitches[loop]->mHasValue)
-        {
-            valueText = " <value>";
-        }
-        else
-        {
-            valueText = "";
-        }
-
-        printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText);
-        printf("\t %s%s", gSwitches[loop]->mShortName, valueText);
-        printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription);
-    }
-
-    printf("This tool normalizes MS linker .map files for use by other tools.\n");
-}
-
-
-int batchMode(Options* inOptions)
-/*
-**  Batch mode means that the input file is actually a list of map files.
-**  We simply swap out our input file names while we do this.
-*/
-{
-    int retval = 0;
-    char lineBuf[0x400];
-    FILE* realInput = NULL;
-    char* realInputName = NULL;
-    FILE* mapFile = NULL;
-    int finalRes = 0;
-
-    realInput = inOptions->mInput;
-    realInputName = inOptions->mInputName;
-
-    while(0 == retval && NULL != fgets(lineBuf, sizeof(lineBuf), realInput))
-    {
-        trimWhite(lineBuf);
-
-        /*
-        **  Skip/allow blank lines.
-        */
-        if('\0' == lineBuf[0])
-        {
-            continue;
-        }
-
-        /*
-        **  Override what we believe to be the input for this line.
-        */
-        inOptions->mInputName = lineBuf;
-        inOptions->mInput = fopen(lineBuf, "r");
-        if(NULL != inOptions->mInput)
-        {
-            int mapRes = 0;
-
-            /*
-            **  Do it.
-            */
-            mapRes = map2tsv(inOptions);
-
-            /*
-            **  We report the first error that we encounter, but we continue.
-            **  This is batch mode after all.
-            */
-            if(0 == finalRes)
-            {
-                finalRes = mapRes;
-            }
-            
-            /*
-            **  Close the input file.
-            */
-            fclose(inOptions->mInput);
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, lineBuf, "Unable to open map file.");
-            break;
-        }
-    }
-
-    if(0 == retval && 0 != ferror(realInput))
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, realInputName, "Unable to read file.");
-    }
-
-    /*
-    **  Restore what we've swapped.
-    */
-    inOptions->mInput = realInput;
-    inOptions->mInputName = realInputName;
-
-    /*
-    **  Report first map file error if there were no other operational
-    **      problems.
-    */
-    if(0 == retval)
-    {
-        retval = finalRes;
-    }
-
-    return retval;
-}
-
-
-int main(int inArgc, char** inArgv)
-{
-    int retval = 0;
-    Options options;
-
-    retval = initOptions(&options, inArgc, inArgv);
-    if(options.mHelp)
-    {
-        showHelp(&options);
-    }
-    else if(0 == retval)
-    {
-        if(options.mBatchMode)
-        {
-            retval = batchMode(&options);
-        }
-        else
-        {
-            retval = map2tsv(&options);
-        }
-    }
-
-    cleanOptions(&options);
-    return retval;
-}
-
deleted file mode 100644
--- a/tools/codesighs/nm2tsv.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-
-#define ERROR_REPORT(num, val, msg)   fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg));
-#define CLEANUP(ptr)    do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0)
-
-
-typedef struct __struct_Options
-/*
-**  Options to control how we perform.
-**
-**  mProgramName    Used in help text.
-**  mInput          File to read for input.
-**                  Default is stdin.
-**  mInputName      Name of the file.
-**  mOutput         Output file, append.
-**                  Default is stdout.
-**  mOutputName     Name of the file.
-**  mHelp           Whether or not help should be shown.
-*/
-{
-    const char* mProgramName;
-    FILE* mInput;
-    char* mInputName;
-    FILE* mOutput;
-    char* mOutputName;
-    int mHelp;
-}
-Options;
-
-
-typedef struct __struct_Switch
-/*
-**  Command line options.
-*/
-{
-    const char* mLongName;
-    const char* mShortName;
-    int mHasValue;
-    const char* mValue;
-    const char* mDescription;
-}
-Switch;
-
-#define DESC_NEWLINE "\n\t\t"
-
-static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."};
-static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."};
-static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."};
-
-static Switch* gSwitches[] = {
-        &gInputSwitch,
-        &gOutputSwitch,
-        &gHelpSwitch
-};
-
-
-char* scanWhite(char* inScan)
-/*
-**  Scan for whitespace.
-*/
-{
-    char* retval = inScan;
-
-    while('\0' != *retval && 0 == isspace(*retval))
-    {
-        retval++;
-    }
-
-    return retval;
-}
-
-
-void trimWhite(char* inString)
-/*
-**  Remove any whitespace from the end of the string.
-*/
-{
-    int len = strlen(inString);
-
-    while(len)
-    {
-        len--;
-
-        if(isspace(*(inString + len)))
-        {
-            *(inString + len) = '\0';
-        }
-        else
-        {
-            break;
-        }
-    }
-}
-
-
-int nm2tsv(Options* inOptions)
-/*
-**  Read all input.
-**  Output tab separated value data.
-**
-**  We expect our data to be in a particular format.
-**  nm --format=bsd --size-sort --print-file-name --demangle
-*/
-{
-    int retval = 0;
-    char lineBuffer[4096];  /* yes, the are some very large symbols */
-    char* module = NULL;
-    char* size = NULL;
-    char* type = NULL;
-    char* symbol = NULL;
-
-    /*
-    **  Read in the nm file.
-    */
-    while(0 == retval && NULL != fgets(lineBuffer, sizeof(lineBuffer), inOptions->mInput))
-    {
-        trimWhite(lineBuffer);
-
-        /*
-        ** Find the various pieces of information we'll be looking for.
-        */
-        size = strchr(lineBuffer, ':');
-        if(NULL != size)
-        {
-            *size = '\0';
-            size++;
-
-            module = strrchr(lineBuffer, '/');
-            if(NULL == module)
-            {
-                module = lineBuffer;
-            }
-            else
-            {
-                *module = '\0';
-                module++;
-            }
-
-            type = scanWhite(size);
-            *type = '\0';
-            type++;
-
-            symbol = type + 1;
-            *symbol = '\0';
-            symbol++;
-
-            /*
-            **  Skip certain types.
-            */
-            switch(*type)
-            {
-                case '-':
-                    continue;
-                    break;
-                default:
-                    break;
-            }
-
-            /*
-            **  Simply output the data with a little more interpretation.
-            **  First is size.
-            */
-            fprintf(inOptions->mOutput, "%s\t", size);
-
-            /*
-            **  Type, CODE or DATA
-            */
-            switch(toupper(*type))
-            {
-                case 'T': /* text (code) */
-                case 'W': /* weak symbol ??? */
-                    fprintf(inOptions->mOutput, "CODE\t");
-                    break;
-                default:
-                    fprintf(inOptions->mOutput, "DATA\t");
-                    break;
-            }
-
-            /*
-            **  Scope, PUBLIC, STATIC, or UNDEF
-            */
-            if(islower(*type))
-            {
-                fprintf(inOptions->mOutput, "STATIC\t");
-            }
-            else
-            {
-                switch(*type)
-                {
-                    case '?':
-                        fprintf(inOptions->mOutput, "UNDEF\t");
-                        break;
-                    default:
-                        fprintf(inOptions->mOutput, "PUBLIC\t");
-                        break;
-                }
-            }
-
-            /*
-            **  Module name, segment.
-            */
-            fprintf(inOptions->mOutput, "%s\t", module);
-            fprintf(inOptions->mOutput, "%c\t", toupper(*type));
-
-            /*
-            **  Origin
-            */
-            fprintf(inOptions->mOutput, "UNDEF:%s:%c\t", module, toupper(*type));
-
-            /*
-            **  Symbol is last.
-            */
-            fprintf(inOptions->mOutput, "%s\n", symbol);
-        }
-        else
-        {
-            retval = __LINE__;
-            ERROR_REPORT(retval, lineBuffer, "Malformed input line.");
-        }
-    }
-
-    if(0 == retval && 0 != ferror(inOptions->mInput))
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, inOptions->mInputName, "Unable to read file.");
-    }
-
-    return retval;
-}
-
-
-int initOptions(Options* outOptions, int inArgc, char** inArgv)
-/*
-**  returns int     0 if successful.
-*/
-{
-    int retval = 0;
-    int loop = 0;
-    int switchLoop = 0;
-    int match = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    Switch* current = NULL;
-
-    /*
-    **  Set any defaults.
-    */
-    memset(outOptions, 0, sizeof(Options));
-    outOptions->mProgramName = inArgv[0];
-    outOptions->mInput = stdin;
-    outOptions->mInputName = strdup("stdin");
-    outOptions->mOutput = stdout;
-    outOptions->mOutputName = strdup("stdout");
-
-    if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName)
-    {
-        retval = __LINE__;
-        ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup.");
-    }
-
-    /*
-    **  Go through and attempt to do the right thing.
-    */
-    for(loop = 1; loop < inArgc && 0 == retval; loop++)
-    {
-        match = 0;
-        current = NULL;
-
-        for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++)
-        {
-            if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-            else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop]))
-            {
-                match = __LINE__;
-            }
-
-            if(match)
-            {
-                if(gSwitches[switchLoop]->mHasValue)
-                {
-                    /*
-                    **  Attempt to absorb next option to fullfill value.
-                    */
-                    if(loop + 1 < inArgc)
-                    {
-                        loop++;
-
-                        current = gSwitches[switchLoop];
-                        current->mValue = inArgv[loop];
-                    }
-                }
-                else
-                {
-                    current = gSwitches[switchLoop];
-                }
-
-                break;
-            }
-        }
-
-        if(0 == match)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch.");
-        }
-        else if(NULL == current)
-        {
-            outOptions->mHelp = __LINE__;
-            retval = __LINE__;
-            ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value.");
-        }
-        else
-        {
-            /*
-            ** Do something based on address/swtich.
-            */
-            if(current == &gInputSwitch)
-            {
-                CLEANUP(outOptions->mInputName);
-                if(NULL != outOptions->mInput && stdin != outOptions->mInput)
-                {
-                    fclose(outOptions->mInput);
-                    outOptions->mInput = NULL;
-                }
-
-                outOptions->mInput = fopen(current->mValue, "r");
-                if(NULL == outOptions->mInput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open input file.");
-                }
-                else
-                {
-                    outOptions->mInputName = strdup(current->mValue);
-                    if(NULL == outOptions->mInputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gOutputSwitch)
-            {
-                CLEANUP(outOptions->mOutputName);
-                if(NULL != outOptions->mOutput && stdout != outOptions->mOutput)
-                {
-                    fclose(outOptions->mOutput);
-                    outOptions->mOutput = NULL;
-                }
-
-                outOptions->mOutput = fopen(current->mValue, "a");
-                if(NULL == outOptions->mOutput)
-                {
-                    retval = __LINE__;
-                    ERROR_REPORT(retval, current->mValue, "Unable to open output file.");
-                }
-                else
-                {
-                    outOptions->mOutputName = strdup(current->mValue);
-                    if(NULL == outOptions->mOutputName)
-                    {
-                        retval = __LINE__;
-                        ERROR_REPORT(retval, current->mValue, "Unable to strdup.");
-                    }
-                }
-            }
-            else if(current == &gHelpSwitch)
-            {
-                outOptions->mHelp = __LINE__;
-            }
-            else
-            {
-                retval = __LINE__;
-                ERROR_REPORT(retval, current->mLongName, "No handler for command line switch.");
-            }
-        }
-    }
-
-    return retval;
-}
-
-
-void cleanOptions(Options* inOptions)
-/*
-**  Clean up any open handles.
-*/
-{
-    CLEANUP(inOptions->mInputName);
-    if(NULL != inOptions->mInput && stdin != inOptions->mInput)
-    {
-        fclose(inOptions->mInput);
-    }
-    CLEANUP(inOptions->mOutputName);
-    if(NULL != inOptions->mOutput && stdout != inOptions->mOutput)
-    {
-        fclose(inOptions->mOutput);
-    }
-
-    memset(inOptions, 0, sizeof(Options));
-}
-
-
-void showHelp(Options* inOptions)
-/*
-**  Show some simple help text on usage.
-*/
-{
-    int loop = 0;
-    const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]);
-    const char* valueText = NULL;
-
-    printf("usage:\t%s [arguments]\n", inOptions->mProgramName);
-    printf("\n");
-    printf("arguments:\n");
-
-    for(loop = 0; loop < switchCount; loop++)
-    {
-        if(gSwitches[loop]->mHasValue)
-        {
-            valueText = " <value>";
-        }
-        else
-        {
-            valueText = "";
-        }
-
-        printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText);
-        printf("\t %s%s", gSwitches[loop]->mShortName, valueText);
-        printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription);
-    }
-
-    printf("This tool normalizes nm output for use by other tools.\n");
-    printf("GNU nm is assumed for symbol type determination.\n");
-    printf("i.e. Use this tool to parse the output of:\n");
-    printf("\t/usr/bin/nm --format=bsd --size-sort --print-file-name --demangle <exefile>\n");
-}
-
-
-int main(int inArgc, char** inArgv)
-{
-    int retval = 0;
-    Options options;
-
-    retval = initOptions(&options, inArgc, inArgv);
-    if(options.mHelp)
-    {
-        showHelp(&options);
-    }
-    else if(0 == retval)
-    {
-        retval = nm2tsv(&options);
-    }
-
-    cleanOptions(&options);
-    return retval;
-}
-
deleted file mode 100755
--- a/tools/codesighs/nm_wrap_osx.pl
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl -w
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-use strict;
-
-#
-# A wrapper for nm that produces output listing symbol size.
-#
-my($prev_addr) = 0;
-my($prev_module) = "";
-my($prev_kind) = "";
-my($prev_symbol) = "";
-
-open(NM_OUTPUT, "nm -fnol $ARGV[0] | c++filt |") or die "nm failed to run on $ARGV[0]\n";
-while (<NM_OUTPUT>)
-{
-  my($line) = $_;
-  chomp($line);
-  
-  if ($line =~ /^([^:]+):\s*([0-9a-f]{8}) (\w) (.+)$/)
-  {
-    my($module) = $1;
-    my($addr)   = $2;
-    my($kind)   = $3;
-    my($symbol) = $4;
-
-    #Skip absolute addresses, there should be only a few
-    if ('a' eq lc $kind) {
-        if ('trampoline_size' ne $symbol) {
-            warn "Encountered unknown absolutely addressed symbol '$symbol' in $module";
-        }
-        next;
-    }
-
-    # we expect the input to have been piped through c++filt to
-    # demangle symbols. For some reason, it doesn't always demangle
-    # all of them, so push still-mangled symbols back through c++filt again.
-    if ($symbol =~ /^(_[_Z].+)/)
-    {
-      # warn "Trying again to unmangle $1\n";
-      $symbol = `c++filt '$1'`;
-      chomp($symbol);
-      # warn "Unmangling again to $symbol\n";
-    }
-
-    my($prev_size) = hex($addr) - hex($prev_addr);
-    # print "Outputting line $line\n";
-
-    # always print one behind, because only now do we know its size
-    if ($prev_module ne "") {
-      printf "%s:%08x %s %s\n", $prev_module, $prev_size, $prev_kind, $prev_symbol;
-    }
-      
-    $prev_addr   = $addr;
-    $prev_module = $module;
-    $prev_kind   = $kind;
-    $prev_symbol = $symbol;
-  }
-  else
-  {
-    # warn "   Discaring line $line\n";
-  }
-}
-
-# we don't know how big the last symbol is, so always show 4.
-if ($prev_module ne "") {
-  printf "%s:%08x %s %s\n", $prev_module, 4, $prev_kind, $prev_symbol;
-}
deleted file mode 100755
--- a/tools/codesighs/readelf_wrap.pl
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/perl -w
-# -*- Mode: perl; tab-width: 4; indent-tabs-mode: nil; -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-use strict;
-
-# Section fields (the full list of values is in <elf.h>)
-my $SECT_NUM  = 0;  # section index
-my $SECT_NAME = 1;  # section name
-my $SECT_TYPE = 2;  # section type
-my $SECT_ADDR = 3;  # section virtual address
-my $SECT_OFF  = 4;  # section offset in file
-my $SECT_SIZE = 5;  # size of section
-my $SECT_ES   = 6;  # section entry size
-my $SECT_FLG  = 7;  # section flags
-my $SECT_LK   = 8;  # link to another section
-my $SECT_INF  = 9;  # additional section info
-my $SECT_AL   = 10; # section alignment
-
-
-# Symbol fields (note: the full list of possible values for each field
-# is given in <elf.h>)
-
-my $SYM_NUM   = 0;     # unique index of the symbol
-my $SYM_VALUE = 1;     # value of the symbol
-my $SYM_SIZE  = 2;     # size of the symbol
-my $SYM_TYPE  = 3;     # type (NOTYPE, OBJECT, FUNC, SECTION, FILE, ...)
-my $SYM_BIND  = 4;     # binding/scope (LOCAL, GLOBAL, WEAK, ...)
-my $SYM_VIS   = 5;     # visibility (DEFAULT, INTERNAL, HIDDEN, PROTECTED)
-my $SYM_NDX   = 6;     # index of section the symbol is in
-my $SYM_NAME  = 7;     # name of the symbol
-my $SYM_FILE  = 8;     # (not part of readelf) file for symbol
-
-# Tell readelf to print out the list of sections and then the symbols
-die "Usage: $^X <binary>\n" unless ($#ARGV >= 0);
-my $readelf = $ENV{'READELF_PROG'};
-if (!$readelf) {
-    $readelf = 'readelf';
-}
-open(READELF_OUTPUT, "$readelf -Ss $ARGV[0] 2>/dev/null | c++filt |") or die "readelf failed to run on $ARGV[0]\n";
-
-my @section_list;
-my @symbol_list;
-my ($module) = ($ARGV[0] =~ /([^\/]+)$/);
-my $in_symbols = 0;
-
-while (<READELF_OUTPUT>) {
-
-    if (!$in_symbols) {
-        if (/^ *\[ *(\d+)\]/) {
-            my @section;
-
-            # note that we strip off the leading '.' of section names for
-            # readability
-            if (! (@section = (/^ *\[ *(\d+)\] \.([\w\.\-]+) *(\w+) *(.{8}) (.{6}[0-9a-fA-F]*) (.{6}[0-9a-fA-F]*) *(\d+) ([a-zA-Z]+ +| +[a-zA-Z]+|) *(\d+) *(\w+) *(\d+)/))) {
-                # capture the 'null' section which has no name, so that the
-                # array indices are the same as the section indices.
-
-                @section = ($1, '', 'NULL', '00000000', '000000', '000000',
-                            '00', '', '0', '0', '0');
-            }
-
-            push (@section_list, \@section);
-        } elsif (/^Symbol table/) {
-            $in_symbols = 1;
-        }
-    } else {
-
-        my @sym;
-
-        if (@sym = /^\s*(\d+): (\w+)\s*(\d+)\s*(\w+)\s*(\w+)\s*(\w+)\s*(\w+) (.*)/)
-        {
-            # Filter out types of symbols that we don't care about:
-            #  - anything that's not of type OBJECT or FUNC
-            #  - any undefined symbols (ndx = UND[EF])
-            #  - any 0-size symbols
-
-            if (($sym[$SYM_TYPE] !~ /^(OBJECT|FUNC)$/) ||
-                $sym[$SYM_NDX] eq 'UND' || $sym[$SYM_NDX] eq 'UNDEF'
-                || $sym[$SYM_SIZE] eq '0') {
-                next;
-            }
-            push (@symbol_list, \@sym);
-        }
-        elsif (/^Symbol table .*'\.symtab'/) {
-            # We've been using .dynsym up to this point, but if we have .symtab
-            # available, it will have everything in .dynsym and more.
-            # So, reset our symbol list.
-
-            @symbol_list = ();
-        }
-    }
-}
-
-close(READELF_OUTPUT);
-
-# spit them out in codesighs TSV format
-my $sym;
-my @section_sizes;
-$#section_sizes = $#section_list;
-foreach (@section_sizes) { $_ = 0; }
-
-foreach $sym (@symbol_list) {
-    # size
-    printf "%08x\t", $sym->[$SYM_SIZE];
-
-    # code or data
-    if ($sym->[$SYM_TYPE] eq 'FUNC') {
-        print "CODE\t";
-    } else {  # OBJECT
-        print "DATA\t";
-    }
-
-    # scope
-    if ($sym->[$SYM_BIND] eq 'LOCAL') {
-        print "STATIC\t";
-    } elsif ($sym->[$SYM_BIND] =~ /(GLOBAL|WEAK)/) {
-        print "PUBLIC\t";
-    } else {
-        print "UNDEF\t";
-    }
-
-    # module name
-
-    print "$module\t";
-
-    # section
-    my $section = $section_list[$sym->[$SYM_NDX]]->[$SECT_NAME];
-    print "$section\t";
-
-    # should be the object file, but for now just module/section
-    print "UNDEF:$module:$section\t";
-
-    # now the symbol name
-    print $sym->[$SYM_NAME]."\n";
-
-    # update our cumulative section sizes
-    $section_sizes[$section_list[$sym->[$SYM_NDX]]->[$SECT_NUM]] += $sym->[$SYM_SIZE];
-}
-
-# Output extra entries to make the sum of the symbol sizes equal the
-# section size.
-
-my $section;
-foreach $section (@section_list) {
-
-    my $diff = hex($section->[$SECT_SIZE]) - $section_sizes[$section->[$SECT_NUM]];
-    if ($diff > 0) {
-        my $sectname = $section->[$SECT_NAME];
-        if ($section->[$SECT_NAME] =~ /^(rodata|data|text|bss)/) {
-            printf "%08x", $diff;
-            print "\tDATA\tSTATIC\t$module\t$sectname\tUNDEF:$module:$sectname\t.nosyms.$sectname\n";
-#        } else {
-#            print "ignoring $diff bytes of empty space in $sectname section\n";
-        }
-    }
-}
--- a/tools/performance/diff-talos.py
+++ b/tools/performance/diff-talos.py
@@ -39,17 +39,17 @@ smaller_is_better = frozenset(('tdhtmlr_
                                'sunspider', 'tp5n_xres_paint', 'num_ctors',
                                'tresize', 'trobopan', 'tcheckerboard',
                                'tcheck3', 'tcheck2', 'tprovider',
                                'tp5n_modlistbytes_paint',
                                'trace_malloc_maxheap', 'tp4m_nochrome',
                                'trace_malloc_leaks', 'tp4m_main_rss_nochrome',
                                'tp4m_shutdown_nochrome', 'tdhtml_nochrome',
                                'ts_shutdown', 'tp5n_%cpu_paint',
-                               'trace_malloc_allocs', 'ts', 'codesighs',
+                               'trace_malloc_allocs', 'ts',
                                'tsvg_nochrome', 'tp5n_content_rss_paint',
                                'tp5n_main_startup_fileio_paint',
                                'tp5n_nonmain_normal_netio_paint',
                                'tp5n_nonmain_startup_fileio_paint',
                                'tp5n_main_normal_fileio_paint',
                                'tp5n_nonmain_normal_fileio_paint',
                                'tp5n_main_startup_netio_paint',
                                'tp5n_main_normal_netio_paint',