Fixes debugging in Java

When deploying a Java program in debug mode any previous running programs should be properly removed. [artf3408]
This should link with (https://usfirst.collab.net/sf/go/artf3408?nav=1&_pagenum=2&returnUrlKey=1408475631056)

[artf3415] is still an issue until NI resolves it.
This should link with (https://usfirst.collab.net/sf/go/artf3415?nav=1&_pagenum=1&returnUrlKey=1408475758258)

Change-Id: Ica9639b5a406b70be4d51aa4e45ffef56baddc93
This commit is contained in:
Jonathan Leitschuh
2014-08-19 15:16:55 -04:00
parent 23b6a980c2
commit 2cc937f5e1
4 changed files with 25 additions and 9 deletions

View File

@@ -2,9 +2,10 @@
username=admin
password=
deploy.dir=/home/admin
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.debug.command = /usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar ${deploy.dir}/FRCUserProgram.jar
deploy.kill.command=. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
deploy.log.command=tail -F -s 0 -n 0 ${deploy.log.file}
debug.flag.dir=/tmp/
command.dir=/home/lvuser/
# Libraries to use

View File

@@ -76,25 +76,35 @@
username="${username}"
password="${password}"
trust="true"
command=". /etc/profile.d/natinst-path.sh; ${deploy.kill.command};"/>
command="${deploy.kill.command};"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
command="${deploy.log.command}"/>
</target>
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
<echo>[athena-deploy] Copying code over.</echo>
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
<!-- The remoteDebugCommand file is used by /usr/local/frc/bin/frcRunRobot.sh on the roboRIO -->
<scp file="${wpilib.ant.dir}/robotDebugCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
<!-- The frcdebug file is used as a flag for /usr/local/frc/bin/frcRunRobot.sh to run the robot program in debug mode -->
<scp file="${wpilib.ant.dir}/frcdebug" todir="${username}@${target}:${debug.flag.dir}" password="${password}" trust="true"/>
<echo>[athena-deploy] Starting program.</echo>
<echo>[athena-deploy] Starting Debug program.</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command=". /etc/profile.d/natinst-path.sh; ${deploy.debug.command}"/>
username="${username}"
password="${password}"
trust="true"
command="${deploy.kill.command}"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.log.command}"/>
</target>
<!-- Simulate -->

View File

@@ -0,0 +1,2 @@
# This file is used as a flag to determine if debugging should be used.
# It is uploaded to the robot when launched in debug mode and should be removed automatically once used.

View File

@@ -0,0 +1,3 @@
/usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y
-jar /home/admin/FRCUserProgram.jar