Skip to content

Commit 70aa308

Browse files
committed
Skip exception breakpoint tests for agent mode (7.0)
1 parent 75c1e23 commit 70aa308

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

luceedebug/src/main/java/luceedebug/DapServer.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,17 @@ public CompletableFuture<Capabilities> initialize(InitializeRequestArguments arg
353353
c.setSupportsHitConditionalBreakpoints(false); // still shows UI for it though
354354
c.setSupportsLogPoints(false); // still shows UI for it though
355355

356-
// Exception breakpoint filters
357-
var uncaughtFilter = new ExceptionBreakpointsFilter();
358-
uncaughtFilter.setFilter("uncaught");
359-
uncaughtFilter.setLabel("Uncaught Exceptions");
360-
uncaughtFilter.setDescription("Break when an exception is not caught by a try/catch block");
361-
c.setExceptionBreakpointFilters(new ExceptionBreakpointsFilter[] { uncaughtFilter });
362-
363356
// Native-mode-only capabilities (require Lucee 7.1+ DebuggerRegistry)
364357
boolean isNativeMode = luceeVm_ instanceof NativeLuceeVm;
358+
359+
// Exception breakpoint filters - only supported in native mode
360+
if (isNativeMode) {
361+
var uncaughtFilter = new ExceptionBreakpointsFilter();
362+
uncaughtFilter.setFilter("uncaught");
363+
uncaughtFilter.setLabel("Uncaught Exceptions");
364+
uncaughtFilter.setDescription("Break when an exception is not caught by a try/catch block");
365+
c.setExceptionBreakpointFilters(new ExceptionBreakpointsFilter[] { uncaughtFilter });
366+
}
365367
c.setSupportsExceptionInfoRequest(isNativeMode);
366368
c.setSupportsBreakpointLocationsRequest(isNativeMode);
367369
c.setSupportsSetVariable(isNativeMode);

test/cfml/DapTestCase.cfm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ function notSupportsExceptionInfo() {
118118
return !supportsExceptionInfo();
119119
}
120120
121+
function supportsExceptionBreakpoints() {
122+
var filters = variables.capabilities.exceptionBreakpointFilters ?: [];
123+
return arrayLen( filters ) > 0;
124+
}
125+
function notSupportsExceptionBreakpoints() {
126+
return !supportsExceptionBreakpoints();
127+
}
128+
121129
function supportsEvaluate() {
122130
return variables.capabilities.supportsEvaluateForHovers ?: false;
123131
}

test/cfml/ExceptionBreakpointsTest.cfc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
3737

3838
// ========== Uncaught Exception Breakpoint ==========
3939

40-
function testUncaughtExceptionBreakpointHits() {
40+
function testUncaughtExceptionBreakpointHits() skip="notSupportsExceptionBreakpoints" {
4141
dap.setExceptionBreakpoints( [ "uncaught" ] );
4242

4343
// Trigger uncaught exception
@@ -50,7 +50,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
5050
cleanupThread( stopped.body.threadId );
5151
}
5252

53-
function testCaughtExceptionDoesNotTriggerUncaughtBreakpoint() {
53+
function testCaughtExceptionDoesNotTriggerUncaughtBreakpoint() skip="notSupportsExceptionBreakpoints" {
5454
dap.setExceptionBreakpoints( [ "uncaught" ] );
5555

5656
// Trigger caught exception
@@ -64,7 +64,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
6464
waitForHttpComplete();
6565
}
6666

67-
function testNoExceptionDoesNotTriggerBreakpoint() {
67+
function testNoExceptionDoesNotTriggerBreakpoint() skip="notSupportsExceptionBreakpoints" {
6868
dap.setExceptionBreakpoints( [ "uncaught" ] );
6969

7070
// Trigger without exception
@@ -80,7 +80,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
8080

8181
// ========== Exception Info ==========
8282

83-
function testExceptionInfoReturnsDetails() skip="notSupportsExceptionInfo" {
83+
function testExceptionInfoReturnsDetails() skip="notSupportsExceptionBreakpoints" {
8484
dap.setExceptionBreakpoints( [ "uncaught" ] );
8585

8686
// Trigger uncaught exception
@@ -101,7 +101,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
101101
cleanupThread( threadId );
102102
}
103103

104-
function testExceptionInfoIncludesType() skip="notSupportsExceptionInfo" {
104+
function testExceptionInfoIncludesType() skip="notSupportsExceptionBreakpoints" {
105105
dap.setExceptionBreakpoints( [ "uncaught" ] );
106106

107107
// Trigger uncaught exception
@@ -121,7 +121,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
121121

122122
// ========== Stack Trace at Exception ==========
123123

124-
function testStackTraceAtException() {
124+
function testStackTraceAtException() skip="notSupportsExceptionBreakpoints" {
125125
dap.setExceptionBreakpoints( [ "uncaught" ] );
126126

127127
// Trigger uncaught exception
@@ -144,7 +144,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
144144

145145
// ========== Variables at Exception ==========
146146

147-
function testVariablesAtException() {
147+
function testVariablesAtException() skip="notSupportsExceptionBreakpoints" {
148148
dap.setExceptionBreakpoints( [ "uncaught" ] );
149149

150150
// Trigger uncaught exception
@@ -165,7 +165,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="dap" {
165165

166166
// ========== Continue After Exception ==========
167167

168-
function testContinueAfterException() {
168+
function testContinueAfterException() skip="notSupportsExceptionBreakpoints" {
169169
dap.setExceptionBreakpoints( [ "uncaught" ] );
170170

171171
// Trigger uncaught exception

0 commit comments

Comments
 (0)