Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before debugging one of your classes, don't forget to run the appropriate Ant build tasks (in some cases, you may need to precede these with the clean task. Otherwise, some of the classes that get loaded at runtime may be outdated.

Remote debugging

You can debug remotely (with Eclipse) as such:

  1. In order to debug a specific agent, run it in debug mode with an accepting socket of a specific port. This is done as such:
    1. Locate the command for the agent running: "java -classpath dist/ct3.jar SomeAgent SomePin Argument1 Argument2"
    2. Change as such: "java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=6079,server=y,suspend=n -classpath dist/ct3.jar SomeAgent SomePin Argument1 Argument2"
    3. In this example, we opened as socket at port 6079 which will be the debugging server.
  2. In Eclipse, start a new remote debugging session by:
    1. choosing "Run" --> "Debug configurations"...
    2. Creating a new configuration under "Remote Java Application". Give it a name (e.g. "My remote agent debug").
    3. Connection Type is: "Standard (Socket Attach)"
    4. Host is: "localhost". You can choose a different machine by a NetBIOS name or IP as well.
    5. Port is: "6079" (in our example).
    6. In the source tab, select the correct source folder. It is also recommended to make it include subfolders as well.
    7. After launching the agent, click on "Debug". You can add breakpoints as you wish.