Integrating the features of JSwat with your software is easily
done using the latest version of the debugger. JSwat is based on
the NetBeans
Platform, written as a set of modules, and licensed under the
Common Development and
Distribution License. The core module defines a set of services
for the various key components of the debugger, which can be
programmatically replaced at runtime with software of your own
making. That is, you can override some or all of the base
functionality in JSwat with your custom code, allowing you to
better integrate JSwat with your system. To learn more, read the
developer documentation in the docs/dev
directory of
the JSwat source tree. In particular, see the instructions for
building the API documentation, then take a look at the NetBeans
Platform documentation
to learn about writing modules for JSwat on NetBeans.
If you need help getting started, or encounter problems during development, you can send email to the jswat-dev mailing list.
If you want to launch JSwat from your software and have it connect to a debuggee, set the sourcepath, or even set a breakpoint and run to a particular line of code, use the following "API".
JSwat detects the following system properties during startup, which allow it to connect to a debuggee that has been started by an external program:
dt_socket
, dt_shmem
localhost:5858
,
jpdaconn
JSwat detects the following system properties during startup, which specify a class and classpath for which to launch a locally running debuggee:
org.pkg.Klass arg1 arg2 arg3...
/path1:/path2:/path3
jswat.launch
property./usr/java
java.exe
-client
The following settings are optional and used in both the remote connect and local launch scenarios.
/path1:/path2:/path3
org.pkg.Klass.main(java.lang.String[])
The sourcepath and runto values should be quoted and contain no spaces, otherwise the launcher will get confused. For example:
./bin/jswat -J-Djswat.transport=dt_socket -J-Djswat.address=5858 -J-Djswat.sourcepath="/java/jswat/core/test/integration/src" -J-Djswat.runto="PackRat.main(java.lang.String[])"