Skip to content

Commit f52dedd

Browse files
committed
Update docs for Maven migration, add AGENTS.md
1 parent 505598f commit f52dedd

File tree

3 files changed

+89
-11
lines changed

3 files changed

+89
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ test-output.txt
2828
# Markdown (except docs)
2929
*.md
3030
!README.md
31+
!AGENTS.md
3132
!JAVA_AGENT.md
3233
!docs/*.md

AGENTS.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# AGENTS.md
2+
3+
Debug Adapter Protocol (DAP) debugger for Lucee CFML.
4+
5+
## Project Overview
6+
7+
This is a step debugger that lets you set breakpoints, inspect variables, and step through CFML code in VS Code.
8+
9+
Two modes:
10+
11+
- **Extension mode** (Lucee 7.1+) - Native debugger hooks, no Java agent required
12+
- **Agent mode** (older Lucee) - Java agent with JDWP, bytecode instrumentation
13+
14+
## Repository Structure
15+
16+
```
17+
extension-debugger/
18+
├── source/java/ # Main Java source (extension + shared code)
19+
├── agent/ # Agent-specific build (shaded JAR)
20+
├── vscode-client/ # VS Code extension (TypeScript)
21+
├── test/ # CFML integration tests
22+
└── .github/workflows/ # CI - tests against Lucee 7.0 and 7.1
23+
```
24+
25+
## Building
26+
27+
```bash
28+
# Extension (.lex)
29+
mvn clean install -Dgoal=install
30+
31+
# Agent (shaded JAR)
32+
cd agent && mvn clean package
33+
```
34+
35+
## Key Classes
36+
37+
- `DapServer` - DAP protocol handler (lsp4j)
38+
- `ExtensionActivator` - Lucee startup hook (extension mode)
39+
- `Agent` - Java agent premain (agent mode)
40+
- `NativeLuceeVm` - 7.1+ native debugger integration
41+
- `LuceeVm` - Agent mode with JDWP/bytecode instrumentation
42+
- `DebugManager` - Breakpoint and stepping logic
43+
44+
## Testing
45+
46+
CFML integration tests run via GitHub Actions against:
47+
48+
- Lucee 7.1 (extension mode)
49+
- Lucee 7.0, 6.2 (agent mode)
50+
51+
The test architecture uses two separate Lucee instances:
52+
53+
- **Debuggee**: Lucee Express (Tomcat) with luceedebug installed, DAP on port 10000, HTTP on 8888
54+
- **Test runner**: `lucee/script-runner` instance running TestBox specs that connect to the debuggee via DAP
55+
56+
Tests set breakpoints, trigger HTTP requests to the debuggee, and verify the debugger stops at the right places.
57+
58+
### Debugging GitHub Actions Failures
59+
60+
When a workflow fails, download logs locally for inspection:
61+
62+
```bash
63+
# Create test-output folder (already in .gitignore)
64+
mkdir -p test-output
65+
66+
# Download all logs from a failed run
67+
gh run view <RUN_ID> --repo lucee/extension-debugger --log > test-output/run-<RUN_ID>.log
68+
69+
# Or download artifacts (contains debuggee logs on failure)
70+
gh run download <RUN_ID> --repo lucee/extension-debugger --dir test-output/
71+
72+
# Search logs locally
73+
grep -E "ERROR|Exception|Failed" test-output/run-<RUN_ID>.log
74+
```
75+
76+
Always use `test-output/` for workflow logs - it's gitignored so won't pollute the repo.
77+
78+
## Code Style
79+
80+
- Java 11+
81+
- No Guava - use JDK or custom utils in `util/` package
82+
- Tabs for indentation
83+
- Fail fast - avoid defensive null checks

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,18 @@ If breakpoints aren't binding, use the command palette and run "luceedebug: show
182182
### Build the Extension (.lex)
183183

184184
```bash
185-
./gradlew buildExtension
185+
mvn clean install -Dgoal=install
186186
```
187187

188-
Output: `build/luceedebug-extension.lex`
188+
Output: `target/debugger-extension-{version}.lex`
189189

190190
### Build the Agent Jar
191191

192192
```bash
193-
./gradlew shadowJar
193+
cd agent && mvn clean package
194194
```
195195

196-
Output: `luceedebug/build/libs/luceedebug.jar`
196+
Output: `agent/target/debugger-agent-{version}.jar`
197197

198198
### Build the VS Code Extension
199199

@@ -204,12 +204,6 @@ npm run build-dev-windows # Windows
204204
npm run build-dev-linux # Mac/Linux
205205
```
206206

207-
## Security Scanning
208-
209-
```bash
210-
./gradlew dependencyCheckAnalyze
211-
```
212-
213207
## How It Works (Technical Details)
214208

215209
Both modes work by inserting debug hooks into Lucee's compiled bytecode, but they do it differently:
@@ -239,6 +233,6 @@ This requires:
239233
- JVM startup flags to enable the agent and JDWP
240234
- Bytecode instrumentation at class load time
241235

242-
**Note:** The bytecode instrumentation used with the agent can occasionally cause issues with complex CFCs, particularly those with many methods or deeply nested closures.
236+
**Note:** The bytecode instrumentation used with the agent can occasionally cause issues with complex CFCs, particularly those with many methods or deeply nested closures.
243237

244238
The Lucee extension/native approach avoids these issues since the debug hooks are part of Lucee's own bytecode generation.

0 commit comments

Comments
 (0)