Source editor with tree view, breakpoints and a Java debugger (JDI) for the code that runs in Vibecat: edit, build, hot swap, stop at breakpoints, step, inspect variables.
| Id | debugger |
|---|---|
| Role | debugger - needed for the page and the REST API (administrators always may) |
| Page | Plugins > Open (overlay with an X at the top right) or /plugins/debugger/ |
| REST | /api/plugins/debugger/… and, for callers with the role, /plugins/debugger/… |
In the administration open Plugins, select the row of this plug-in and press Open. The page opens in an overlay dialog: close it with the X at the top right, with Esc or by clicking outside; Open in a new tab next to the title shows it full size.
The page has these sections: Source + File + Folder Delete, Build output Debugger log, Debug detached, Variables, Breakpoints Remove all, Workspace.
| Label | Meaning |
|---|---|
| Name | |
| Folder on the server | |
| Source folders (relative, comma separated; empty: from the Eclipse .classpath, else src) | |
| Output folder with the class files (hot swap; empty: bin) | |
| Build command (run in the folder, e.g. ant CreateJAR or mvn -q compile ) | |
| … or upload a source package (ZIP) |
Edit the source code of the code that runs in Vibecat - a web application, an ELO Indexserver plug-in - and debug it where it runs: set breakpoints in the editor, let the server hit them, step through the code and look at the variables. The editor is the cloccojs code editor, the file browser the cloccojs tree view.
A workspace is a folder with source code. Two ways to get one (button New…):
C:\Entwicklung\Sysworx\JavaFramework\eloixplugins\sysworx-ixhelper-plugins): the files are edited in place. The source folders and the output folder are read from the Eclipse .classpath (else src and bin).The tree shows the folder, a click opens a file (several files = tabs), Save or Ctrl+S writes it. + File, + Folder and Delete work on the selected node. Only text files up to 3 MB are opened.
Click in the gutter left of a line number of a Java file: a red dot = the breakpoint is set in the running JVM, an amber dot = waiting (the class is not loaded yet, it is set as soon as it is), a grey ring = disabled. The panel Breakpoints lists them (enable, disable, jump). Breakpoints are kept across restarts. They need line numbers in the class files (the default of the Java compiler and of Eclipse; -g adds the local variable names).
set VIBECAT_DEBUG_PORT=5005 before vibecat.cmd; as Windows service install-windows.ps1 -DebugPort 5005 (or add -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005 to the Java options of the service, for example with Vibecat Server Status, Settings, Options, and restart the service); Linux: the same option in vibecat.sh. The agent listens on 127.0.0.1 only: anybody who can reach the port controls the JVM, never open it to the network without a firewall.Careful: a breakpoint in a code path the administration itself uses (the Tomcat of the administration port, this plug-in) stops that request: the page may not answer until you resume (use the auto resume setting, or debug from another browser window).
Build runs the build command of the workspace (Workspace…) in its folder, for example ant CreateJAR; the output is shown below the editor. Apply classes (hot swap) replaces the loaded classes that have a newer class file in the output folder, without a restart: only the bodies of methods may change (the JVM refuses added or removed methods and fields). For the Indexserver plug-in: let Eclipse (or the build command) compile to bin, then Apply classes, then repeat the call that stops at the breakpoint.
Base /api/plugins/debugger (administration port, HTTP Basic, role debugger or administrator): GET /workspaces, GET /ws/{id}/tree?node=, GET|PUT /ws/{id}/file?path=, POST /ws/{id}/build, GET|POST /breakpoints, GET /debug, POST /debug/connect|disconnect|resume|stepover|stepinto|stepout|hotswap, GET /debug/variables?thread=&frame=. A user with this role can run code control over the whole server: give the role only to administrators of the server.