Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Debugging Techniques (http://www.chiefdelphi.com/forums/showthread.php?t=89740)

pigpc1993 21-01-2011 18:06

Debugging Techniques
 
My team and I are trying to figure out how to debug. Also When we use System.out.println were does it print to. It's not going to NetBeans or the Control Center. Any help would be awesome!

sjspry 22-01-2011 20:54

Re: Debugging Techniques
 
It should be going to the build process window. If you have it hidden you might not have seen it.

pigpc1993 22-01-2011 20:56

Re: Debugging Techniques
 
Quote:

Originally Posted by sjspry (Post 1006009)
It should be going to the build process window. If you have it hidden you might not have seen it.

I don't see it. :/

sjspry 22-01-2011 20:57

Re: Debugging Techniques
 
Once you hit run, you should see the messages of it compiling and trying to flash the cRIO's memory in a window. Any printlns should appear there.

If they don't, I'm surprised you can program it at all.

Jeanne Boyarsky 22-01-2011 22:30

Re: Debugging Techniques
 
Yes, it should appear in your NetBeans console if you loaded the code from there. If the code was loaded from another computer or from another machine, your NetBeans doesn't know about it. You can launch the "net console" on the machine with the Driver Station to force the System.out results to go there. (I just learned this yesterday! We'd always used NetBeans last year.)

Alternative forms of debugging are to send small output to the DashBoard (or better yet this year's SmartDashboard.) System.out is usually simpler though.

Remember to take out the System.outs when you are done as output slows down the code. (I/O takes longer than CPU.)

ksanger 23-01-2011 10:29

Re: Debugging Techniques
 
MaK211 Team can not debug either. We can compile and download code which will run. But when we compile and download through the Netbeans debugger the PC just hangs. We do see the download and the reboots. In the 2010 version (Pre 2011 Upgrade) we would eventually get a message stating waiting for connection. In the 2011 version we get nada. The dashboard shows no program code. If we right click on the Debug Project Icon and select Attach there is no port specified on the form and the OK button is grayed out. We have not been able to find any 2011 instructions for debugging in Java with Netbeans.

All ideas are welcome. :)

pigpc1993 25-01-2011 17:27

Re: Debugging Techniques
 
What happens is that once the code compiles and sends we leave it connected to the robot we launch the Classmate DriveStation and run out program. Nothing logs on NetBeans.

ksanger 25-01-2011 18:49

Re: Debugging Techniques
 
For normal program execution we do that too. Download code, see it on the dashboard, then set to Autonomous or Teleoperated...

Its only when we want to set a breakpoint and launch the debugger do we have an issue where the laptop with the debugger on it doesn't get to the point where the debugger runs. Nor does the dashboard application see the robot code deploy. It shouldn't because the debugger is not running yet. We still need help with how to get the debugger to run.

AllenGregoryIV 04-02-2011 22:54

Re: Debugging Techniques
 
So we just started playing with CAN today (Java and CAN-Serial converter) but now we can't see the println's anymore because the console out is disabled.

How do other teams debug code with out print statements?

That is the only system I have used for FIRST robots.

Setting up a dashboard doesn't seem to give the same information. We know we can do file out but we can't get live updates while the robot is running.

Has anyone else found a simple solution to this problem?

Edited: I got the printlns working again, not really sure what the problem is but now CAN won't work getting an error when I try to initialize any jaguars: "edu.wpi.first.wpilibj.util.UncleanStatusException : Fatal status code detected: -1"

alexhenning 07-02-2011 21:44

Re: Debugging Techniques
 
There's a net console if you're using CAN. I'm using the eclipse plugin and it automatically shows it. If it doesn't open a terminal cd into the project directory and run "ant echo" and you should get output. You need to make sure you're on the right netmask is 255.0.0.0 for whatever reason, my router dynamically assigns me 255.255.255.0 sometimes.

The one problem I've had with netconsole is if you print to fast, the router gets slow and it can cause issues so just limit the rate at which you print.

jhersh 08-02-2011 02:45

Re: Debugging Techniques
 
Quote:

Originally Posted by alexhenning (Post 1018026)
The one problem I've had with netconsole is if you print to fast, the router gets slow and it can cause issues so just limit the rate at which you print.

That should be greatly improved by the v27 image. The NetConsole server now batches output into larger packets.

alexhenning 08-02-2011 06:41

Re: Debugging Techniques
 
Quote:

Originally Posted by jhersh (Post 1018236)
That should be greatly improved by the v27 image. The NetConsole server now batches output into larger packets.

Thanks! That is great to know.

twiggzee 09-10-2011 09:37

Re: Debugging Techniques
 
we're new to java this year and trying to get the debugger to run. we're having the same experience as ksanger described here. was there ever a solution found?

ksanger 09-10-2011 11:40

Re: Debugging Techniques
 
Wendy; We never did get the debugger to work. Our team is just starting up again this fall and maybe we'll get to try again in a month or two. Good luck and welcome to USFirst Robotics.

twiggzee 10-10-2011 01:35

Re: Debugging Techniques
 
ok thanks. i have new info and more questions.

since i wasn't able to get the debugger to work, i tried hard wiring it instead of doing it through wifi. that seemed to work fine.

does this mean that we have to be hard wired to debug? my common sense tells me that this is not practical. i should not have to follow our robot around with my laptop connected in order to debug code, right?

are there teams out there that can attach a debugger through wireless connection? if so, any help is much appreciated.

this is what is displayed in the output window.

in the debugger console:
Attaching to Wendy:2900
then it just sits there forever.

in the Team3502 (deploy,debug-run) Window:

init:
init:
Deleting directory C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\build
Deleting directory C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Deleting directory C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\j2meclasses
clean:
Created dir: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\build
Compiling 2 source files to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\build
compile:
Created dir: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\j2meclasses
preverify:
Created dir: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Building jar: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite\Team3502_1.0.0.jar
jar-app:
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
[translating suite image [closed: false, parent: squawk] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
[Including resource: META-INF/MANIFEST.MF]
Romizer processed 113 classes and generated 4 files.
Expanding: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite\Team3502_1.0.0.jar into C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Moving 1 file to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Moving 1 file to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Moving 1 file to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Deleting: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\image.suite.api
Host OS: Windows XP 5.1, 5.1
Host JVM: Java HotSpot(TM) Client VM 19.1-b02
Target IP: 10.35.2.2
Network interfaces on host:
Intel(R) PRO/Wireless 3945ABG Network Connection - McAfee Core NDIS Intermediate Filter Miniport: address: 10.35.2.4 netmask: 255.0.0.0 <--- on robot's subnet
Connecting FTP @10.35.2.2
upgrade:
Sending local file image.suite
flashapp:
deploy:
debug-run:
do-debug-run:
[cRIO] [OTA Server] ********* REBOOTING cRIO *********
[cRIO]
Waiting for cRIO to reboot (1s)
Waiting for cRIO to reboot (2s)
Waiting for cRIO to reboot (3s)
Waiting for cRIO to reboot (4s)
Waiting for cRIO to reboot (5s)
Waiting for cRIO to reboot (6s)
Waiting for cRIO to reboot (7s)
[cRIO]
Connect debugger attempt 1
Connecting NetBeans debugger
Start debug proxy
init:
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Trying to connect to VM on socket://10.35.2.2:2800
[cRIO] -> * Loading StartupDlls: debug
[cRIO] Entering debug.o StartupLibraryInit
[cRIO] Debugging is up, target server mounted at /tsfs
[cRIO]
[cRIO]
[cRIO] VxWorks
[cRIO]
[cRIO] Copyright 1984-2006 Wind River Systems, Inc.
[cRIO]
[cRIO] CPU: MPC5200 -- Wind River Lite5200 BSP.
[cRIO] Runtime Name: VxWorks
[cRIO] Runtime Version: 6.3
[cRIO] BSP version: 2.0/10
[cRIO] Created: Jul 29 2009, 13:41:47
[cRIO] ED&R Policy Mode: Deployed
[cRIO] WDB Comm Type: WDB_COMM_END
[cRIO] WDB: Ready.
[cRIO]
[cRIO] Leaving debug.o StartupLibraryInit
[cRIO] * Loading StartupDlls: NiRioRpc
[cRIO] * Loading StartupDlls: niorbs
[cRIO] * Loading StartupDlls: NiViSrvr
[cRIO] * Loading StartupDlls: visa32
[cRIO] * Loading StartupDlls: nivissvc
[cRIO] task 0xed1418 (PAL00fa27d0) deleted: errno=0 (0) status=0 (0)
[cRIO] NI-RIO Server 3.2 started successfully.
[cRIO] task 0xc4c8b8 (NiRioRpc) deleted: errno=0 (0) status=0 (0)
[cRIO] * Loading StartupDlls: nivision
Connect debugger attempt 2
Connecting NetBeans debugger
[cRIO] * Loading StartupDlls: niserial
[cRIO] * Loading StartupDlls: FRC_FPGA
[cRIO] * Loading StartupDlls: FRC_NetworkCommunication
[cRIO] task 0x1af5638 (t2) deleted: errno=0 (0) status=0 (0)
[cRIO] FRC_NetworkCommunication was compiled from SVN revision 2258
[cRIO]
[cRIO] NI-VISA Server 4.5 started successfully.
[cRIO] task 0xe4fbe0 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1)
Attached JPDA debugger to localhost:2900
[cRIO] FPGA Hardware GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91
[cRIO] FPGA Software GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91
[cRIO] FPGA Hardware Version: 2011
[cRIO] FPGA Software Version: 2011
[cRIO] FPGA Hardware Revision: 1.5.3
[cRIO] FPGA Software Revision: 1.5.3
[cRIO] * Loading StartupDlls: FRC_JavaVM
[cRIO]
[cRIO]
[cRIO] [OTA Server] Version: 2011 FRC, Jan 6 2011, 09:47:42
[cRIO]
[cRIO]
[cRIO] Welcome to LabVIEW Real-Time 8.6.1f3
[cRIO]
[cRIO] [Squawk VM] Version: 2011 FRC, Feb 18 2011, 15:57:21
[cRIO] [Squawk VM] File SQUAWK_DEBUG_ENABLED found, starting squawk in debug mode...
[cRIO] Listening for connection from proxy on serversocket://:2800
Failed to establish connection with VM: Connection timed out: connect - trying again in 5 seconds...
Trying to connect to VM on socket://10.35.2.2:2800
Established connection to VM (handshake took 16ms)
[cRIO] FPGA Hardware GUID: 0x2eaa5e59caf1a8a966853a011b61cc91
[cRIO] FPGA Software GUID: 0x2eaa5e59caf1a8a966853a011b61cc91
Waiting for connection from debugger on serversocket://:2900
Synchronizing debug state with VM...
Established connection to Debugger (handshake took 8813ms)


All times are GMT -5. The time now is 11:17.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi