#!/bin/bash cd $HOME # workaround EVG-12829 cat >> ~/.profile < ./'" EOF export PATH=/opt/mongodbtoolchain/gdb/bin:$PATH echo 'if [ -f ~/.profile ]; then . ~/.profile fi' >> .bash_profile # Make a directory on the larger EBS volume. Soft-link it under the home directory. The smaller home # volume can have trouble particularly with coredumps from sharded timeouts. mkdir /data/debug ln -s /data/debug . cd debug # As the name suggests, pretty printers. Primarily for boost::optional git clone git@github.com:ruediger/Boost-Pretty-Printer.git & # Discover and unarchive necessary files and source code. This will put mongo binaries and their # partner .debug files in the same top-level (`debug`) directory. Shared library files and their # debug symbols will be dumped into a `debug/lib` directory for tidiness. The mongo # `/src/` directory is soft linked as `debug/src`. The .gdbinit file assumes gdb is being # run from the `debug` directory. BIN_ARCHIVE=`ls /data/mci/artifacts-*compile/mongo-*.tgz` tar --wildcards --strip-components=2 -xzf $BIN_ARCHIVE '*/bin/mongod' '*/bin/mongos' '*/bin/mongo' '*/bin/mongobridge' & tar --wildcards --strip-components=1 -xzf $BIN_ARCHIVE '*/lib/*' & DBG_ARCHIVE=`ls /data/mci/artifacts-*compile/debugsymbols-*.tgz` tar --wildcards --strip-components=2 -xzf $DBG_ARCHIVE '*/bin/mongod.debug' '*/bin/mongos.debug' '*/bin/mongo.debug' '*/bin/mongobridge.debug' & tar --wildcards --strip-components=1 -xzf $DBG_ARCHIVE '*/lib/*' & SRC_DIR=`find /data/mci/ -maxdepth 1 | grep source` ln -s $SRC_DIR/.gdbinit . ln -s $SRC_DIR/src src ln -s $SRC_DIR/buildscripts buildscripts # Install pymongo to get the bson library for pretty-printers. /opt/mongodbtoolchain/v3/bin/pip3 install -r $SRC_DIR/etc/pip/dev-requirements.txt & COREDUMP_ARCHIVE=`ls /data/mci/artifacts-*/mongo-coredumps-*.tgz` tar -xzf $COREDUMP_ARCHIVE & echo "Waiting for background processes to complete." wait cat >> ~/.gdbinit <> ~/.gdbinit