Skip to content

Commit 5515d3b

Browse files
committed
LDEV-1402 switch env var prefix to LUCEE_DAP_ ( was LUCEE_DEBUGGER_ )
1 parent 68fee43 commit 5515d3b

File tree

11 files changed

+31
-31
lines changed

11 files changed

+31
-31
lines changed

core/src/main/java/lucee/runtime/PageContextImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3433,7 +3433,7 @@ public void _setCatch(PageException pe, String name, boolean caught, boolean sto
34333433
FDSignal.signal(pe, caught);
34343434
}
34353435
// External debugger (luceedebug) - frames are still intact at this point
3436-
if (ConfigImpl.DEBUGGER_BREAKPOINT) {
3436+
if (ConfigImpl.DEBUGGER) {
34373437
DebuggerListener listener = DebuggerRegistry.getListener();
34383438
if (listener != null && listener.isClientConnected() && listener.onException( this, pe, caught )) {
34393439
// Get file/line from exception for debugger display
@@ -3553,10 +3553,10 @@ public static final class DebuggerFrame {
35533553
public String getFile() { return pageSource != null ? pageSource.getDisplayPath() : null; }
35543554
}
35553555

3556-
private final LinkedList<DebuggerFrame> debuggerFrames = ConfigImpl.DEBUGGER_BREAKPOINT ? new LinkedList<DebuggerFrame>() : null;
3556+
private final LinkedList<DebuggerFrame> debuggerFrames = ConfigImpl.DEBUGGER ? new LinkedList<DebuggerFrame>() : null;
35573557

35583558
/**
3559-
* Push a new debugger frame onto the stack. Called on UDF entry when DEBUGGER_BREAKPOINT is enabled.
3559+
* Push a new debugger frame onto the stack. Called on UDF entry when DEBUGGER is enabled.
35603560
*/
35613561
public void pushDebuggerFrame(lucee.runtime.type.scope.Local local, lucee.runtime.type.scope.Argument arguments,
35623562
lucee.runtime.type.scope.Variables variables, PageSource pageSource, String functionName, int startLine) {
@@ -3578,7 +3578,7 @@ public void pushDebuggerFrame(lucee.runtime.type.scope.Local local, lucee.runtim
35783578
}
35793579

35803580
/**
3581-
* Pop the topmost debugger frame. Called on UDF exit when DEBUGGER_BREAKPOINT is enabled.
3581+
* Pop the topmost debugger frame. Called on UDF exit when DEBUGGER is enabled.
35823582
*/
35833583
public void popDebuggerFrame() {
35843584
if (debuggerFrames != null && !debuggerFrames.isEmpty()) {
@@ -3626,7 +3626,7 @@ public DebuggerFrame getTopmostDebuggerFrame() {
36263626
* @param label Optional label to identify the breakpoint in debugger UI
36273627
*/
36283628
public void debuggerSuspend(String label) {
3629-
if (!ConfigImpl.DEBUGGER_BREAKPOINT) return;
3629+
if (!ConfigImpl.DEBUGGER) return;
36303630

36313631
// Get current file/line for listener callback
36323632
DebuggerFrame frame = getTopmostDebuggerFrame();
@@ -3664,7 +3664,7 @@ public void debuggerSuspend(String label) {
36643664
* @param label Optional label to identify the breakpoint in debugger UI
36653665
*/
36663666
public void debuggerSuspend(String file, int line, String label) {
3667-
if (!ConfigImpl.DEBUGGER_BREAKPOINT) return;
3667+
if (!ConfigImpl.DEBUGGER) return;
36683668
debuggerSuspendImpl(file, line, label);
36693669
}
36703670

core/src/main/java/lucee/runtime/config/ConfigFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ public static ExecutionLogFactory loadExeLog(ConfigImpl config, Struct root) {
15691569
Map<String, String> args = null;
15701570

15711571
// If debugger breakpoint support enabled and no explicit class configured, use DebuggerExecutionLog
1572-
if (StringUtil.isEmpty(strClass) && ConfigImpl.DEBUGGER_BREAKPOINT) {
1572+
if (StringUtil.isEmpty(strClass) && ConfigImpl.DEBUGGER) {
15731573
LogUtil.log(config, Log.LEVEL_INFO, "application", "Debugger breakpoint support enabled");
15741574
clazz = DebuggerExecutionLog.class;
15751575
args = new HashMap<String, String>();

core/src/main/java/lucee/runtime/config/ConfigImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,25 @@ public abstract class ConfigImpl extends ConfigBase implements ConfigPro {
179179

180180
private static final RHExtension[] RHEXTENSIONS_EMPTY = new RHExtension[0];
181181

182-
// Debugger secret - required to register a debugger listener. If not set, debugger is disabled.
182+
// DAP secret - required to register a debugger listener. If not set, DAP debugger is disabled.
183183
public static final String DEBUGGER_SECRET;
184-
// Debugger enabled if secret is set (non-empty) - enables listener registration and console capture
184+
// DAP enabled if secret is set (non-empty) - enables listener registration and console capture
185185
public static final boolean DEBUGGER_ENABLED;
186-
// Breakpoint support - controls bytecode instrumentation for stepping/breakpoints (default true when debugger enabled)
187-
public static final boolean DEBUGGER_BREAKPOINT;
186+
// DAP debugger active - controls bytecode instrumentation for stepping/breakpoints (default true when secret set)
187+
public static final boolean DEBUGGER;
188188
static {
189-
String secret = SystemUtil.getSystemPropOrEnvVar("lucee.debugger.secret", null);
189+
String secret = SystemUtil.getSystemPropOrEnvVar("lucee.dap.secret", null);
190190
if (secret != null && !secret.trim().isEmpty()) {
191191
DEBUGGER_SECRET = secret.trim();
192192
DEBUGGER_ENABLED = true;
193193
// Breakpoint support defaults to true, can be disabled for console-only mode
194-
String bp = SystemUtil.getSystemPropOrEnvVar("lucee.debugger.breakpoint", "true");
195-
DEBUGGER_BREAKPOINT = "true".equalsIgnoreCase(bp.trim());
194+
String bp = SystemUtil.getSystemPropOrEnvVar("lucee.dap.breakpoint", "true");
195+
DEBUGGER = "true".equalsIgnoreCase(bp.trim());
196196
}
197197
else {
198198
DEBUGGER_SECRET = null;
199199
DEBUGGER_ENABLED = false;
200-
DEBUGGER_BREAKPOINT = false;
200+
DEBUGGER = false;
201201
}
202202
}
203203

@@ -4635,7 +4635,7 @@ public ConfigImpl resetCacheAll() {
46354635

46364636
@Override
46374637
public boolean getExecutionLogEnabled() {
4638-
if (DEBUGGER_BREAKPOINT) return true;
4638+
if (DEBUGGER) return true;
46394639

46404640
if (executionLogEnabled == null) {
46414641
synchronized (SystemUtil.createToken("ConfigImpl", "getExecutionLogEnabled")) {

core/src/main/java/lucee/runtime/debug/DebuggerListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ default int[] getExecutableLines(String absolutePath) {
9898
/**
9999
* Called when a UDF/method is entered.
100100
* Allows debuggers to implement function breakpoints (break on function name).
101-
* Must be fast - called on every function invocation when DEBUGGER_BREAKPOINT is enabled.
101+
* Must be fast - called on every function invocation when DEBUGGER is enabled.
102102
*
103103
* @param pc The PageContext executing
104104
* @param functionName The function name (case as defined in source)

core/src/main/java/lucee/runtime/debug/DebuggerRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ private DebuggerRegistry() {
2323
}
2424

2525
/**
26-
* Set the debugger listener. Requires the correct secret from LUCEE_DEBUGGER_SECRET.
26+
* Set the debugger listener. Requires the correct secret from LUCEE_DAP_SECRET.
2727
* Only one listener is supported - setting a new one replaces the old.
2828
*
2929
* @param l The listener to register, or null to unregister
30-
* @param secret The secret that must match LUCEE_DEBUGGER_SECRET
30+
* @param secret The secret that must match LUCEE_DAP_SECRET
3131
* @return true if registration succeeded, false if secret is invalid
3232
*/
3333
public static boolean setListener(DebuggerListener l, String secret) {

core/src/main/java/lucee/runtime/engine/DebuggerExecutionLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Updates the current debugger frame's line number on each block start.
1313
* Also checks for breakpoints and suspends execution if needed.
1414
*
15-
* This is used when DEBUGGER_BREAKPOINT=true to provide line tracking
15+
* This is used when DEBUGGER=true to provide line tracking
1616
* without requiring bytecode instrumentation in the debugger extension.
1717
*/
1818
public final class DebuggerExecutionLog implements ExecutionLogPro {

core/src/main/java/lucee/runtime/functions/decision/IsDebuggerEnabled.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
public final class IsDebuggerEnabled implements Function {
88

99
public static boolean call(PageContext pc) {
10-
return ConfigImpl.DEBUGGER_ENABLED;
10+
return ConfigImpl.DEBUGGER;
1111
}
1212
}

core/src/main/java/lucee/runtime/functions/system/Breakpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static boolean call(PageContext pc, String label) {
1717

1818
public static boolean call(PageContext pc, String label, boolean condition) {
1919
// Only suspend if debugger breakpoint support is enabled AND a debugger client is connected
20-
if (condition && ConfigImpl.DEBUGGER_BREAKPOINT && DebuggerRegistry.isClientConnected()) {
20+
if (condition && ConfigImpl.DEBUGGER && DebuggerRegistry.isClientConnected()) {
2121
((PageContextImpl) pc).debuggerSuspend(label);
2222
return true;
2323
}

core/src/main/java/lucee/runtime/type/UDFImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ private Object _call(PageContext pc, Collection.Key calledName, Object[] args, S
363363

364364
// Debugger frame support - capture scopes for external debuggers
365365
// Must be AFTER defineArguments so function arguments are accessible for conditional breakpoints
366-
if (ConfigImpl.DEBUGGER_BREAKPOINT) {
366+
if (ConfigImpl.DEBUGGER) {
367367
pci.pushDebuggerFrame(newLocal, newArgs, pc.variablesScope(), ps, getFunctionName(), properties.getStartLine());
368368
}
369369

@@ -398,7 +398,7 @@ private Object _call(PageContext pc, Collection.Key calledName, Object[] args, S
398398
finally {
399399
if (ps != null) pc.removeLastPageSource(psInc != null);
400400
// Debugger frame support - pop before removeUDF to maintain consistency
401-
if (ConfigImpl.DEBUGGER_BREAKPOINT) {
401+
if (ConfigImpl.DEBUGGER) {
402402
pci.popDebuggerFrame();
403403
}
404404
pci.removeUDF();

core/src/main/java/resource/fld/core-base.fld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8213,7 +8213,7 @@ The following things are considered to be empty:
82138213
<name>isDebuggerEnabled</name>
82148214
<class>lucee.runtime.functions.decision.IsDebuggerEnabled</class>
82158215
<keywords>decision,debug,debugger</keywords>
8216-
<description>Returns true if native debugger support is enabled (via LUCEE_DEBUGGER_SECRET env var or lucee.debugger.secret system property). Use with breakpoint() BIF.</description>
8216+
<description>Returns true if DAP debugger support is enabled (via LUCEE_DAP_SECRET env var or lucee.dap.secret system property). Use with breakpoint() BIF.</description>
82178217
<return>
82188218
<type>boolean</type>
82198219
</return>

0 commit comments

Comments
 (0)