====== Debugging jMax ======
==== Introduction ====
jMax run as two processes: a C process running FTS, the real time engine, and
a Java process running the user interfaces.
In order to debug jMax, or an extensions you are writing, you may run one of the two
or even both within debuggers, a C debugger for fts, a Java debugger for the user interface.
==== Running FTS under the debugger ====
This section explains how to run FTS (the real time engine of jMax) under a debugger.
This is usefull for instance if you want to debug your objects.
In order to run FTS under a debugger, FTS must be compiled in debug mode.
Refer to the build documentation for details (currently, debug is the default
compilation mode).
To run FTS under the debugger, start the Java GUI with the following options
jmax -jmaxConnection udpclient -jmaxPort a_port_number
The console window should appear, but remains almost empty.
Than, start the debuggger (for instance with gdb):
$ cd $(JMAX_HOME)/bin
$ gdb fts
And then start fts under the debugger:
run udp my_machine:a_port_number
where: my_machine is the name of the host running FTS (can be 127.0.0.1),
a_port_number is the port number that you gave to
the -jmaxPort option when starting jmax.
The console window should now be filled with normal startup messages. You can
then stop fts under the debugger, put breakpoints, continue, as usual in
a debugger session.
==== Running The Java user interface under the debugger ====
The following instructions apply to an emacs based development environment; if you
use an IDE like Eclipse or Netbeans, refer to your IDE documentation.
First, run jmax with the debug flag, as in:
jmax -debug -jmaxStyle ide
You will get the jMax splash screen, but the application will not actually
start.
Then, start the jdb debugger with the following command:
jdb -listen 8888 -sourcepath:~/projects/jmax-phoenix/trunk/core/jmax
Of course, adapt the sourcepath argument to where your sources are stored.
At this point, you can start the program, put breakpoints and so on using
the jdb commands.