From: Svjatoslav Agejenko Date: Wed, 13 Sep 2017 20:48:02 +0000 (+0300) Subject: added debug script X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=commitdiff_plain;h=04bf0a8bdd6c368805b180ed2b326738c3faa980 added debug script --- diff --git a/tools/debug b/tools/debug new file mode 100755 index 0000000..5640906 --- /dev/null +++ b/tools/debug @@ -0,0 +1,46 @@ +#!/bin/bash + +if [ "$1" != "T" ]; then gnome-terminal -e "'$0' T"; exit; fi + +# +# This is a helper bash script that starts current Java project in debug mode +# with JRebel attached. It also opens its own terminal window, so you can run +# this script by simply clicking on it in file navigator. +# +# +# Script assumes: +# +# + GNU OS +# + Gnome workspace +# + JRebel is installed in /opt/jrebel +# + + +cd "${0%/*}" +cd .. + + +while true; do + + # clear screen + printf "\033c" + + # enable debugging + export DEBUG_OPTIONS="-Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000,server=y,suspend=n" + + # enable JRebel + export REBEL_BASE="$HOME/.jrebel" + export JREBEL_OPTS="-agentpath:/opt/jrebel/libjrebel64.so -Drebel.project.path=`pwd`" + + # enable LWJGL native libraries + export LWJGL_OPTS="-Djava.library.path=target/natives" + + # define Maven options + export MAVEN_OPTS="-Xmx4000m $DEBUG_OPTIONS $JREBEL_OPTS $LWJGL_OPTS" + + mvn compile exec:java -Dexec.mainClass="eu.svjatoslav.sixth.e3d.examples.launcher.Main" + + echo "press ENTER to reload application" + read + +done