@@ -127,13 +127,17 @@ public void terminate() {
127127 }
128128
129129 @ Override
130- public IBreakpoint createBreakpoint (JavaBreakpointLocation sourceLocation , int hitCount , String condition , String logMessage ) {
131- return new EvaluatableBreakpoint (vm , this .getEventHub (), sourceLocation , hitCount , condition , logMessage );
130+ public IBreakpoint createBreakpoint (JavaBreakpointLocation sourceLocation , int hitCount , String condition , String logMessage , int suspendPolicy ) {
131+ EvaluatableBreakpoint breakpoint = new EvaluatableBreakpoint (vm , this .getEventHub (), sourceLocation , hitCount , condition , logMessage );
132+ breakpoint .setSuspendPolicy (suspendPolicy );
133+ return breakpoint ;
132134 }
133135
134136 @ Override
135- public IBreakpoint createBreakpoint (String className , int lineNumber , int hitCount , String condition , String logMessage ) {
136- return new EvaluatableBreakpoint (vm , this .getEventHub (), className , lineNumber , hitCount , condition , logMessage );
137+ public IBreakpoint createBreakpoint (String className , int lineNumber , int hitCount , String condition , String logMessage , int suspendPolicy ) {
138+ EvaluatableBreakpoint breakpoint = new EvaluatableBreakpoint (vm , this .getEventHub (), className , lineNumber , hitCount , condition , logMessage );
139+ breakpoint .setSuspendPolicy (suspendPolicy );
140+ return breakpoint ;
137141 }
138142
139143 @ Override
@@ -142,17 +146,17 @@ public IWatchpoint createWatchPoint(String className, String fieldName, String a
142146 }
143147
144148 @ Override
145- public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught ) {
146- setExceptionBreakpoints (notifyCaught , notifyUncaught , null , null );
149+ public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , int suspendModeOnCaught , int suspendModeOnUncaught ) {
150+ setExceptionBreakpoints (notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , null , null );
147151 }
148152
149153 @ Override
150- public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , String [] classFilters , String [] classExclusionFilters ) {
151- setExceptionBreakpoints (notifyCaught , notifyUncaught , null , classFilters , classExclusionFilters );
154+ public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , int suspendModeOnCaught , int suspendModeOnUncaught , String [] classFilters , String [] classExclusionFilters ) {
155+ setExceptionBreakpoints (notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , null , classFilters , classExclusionFilters );
152156 }
153157
154158 @ Override
155- public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , String [] exceptionTypes ,
159+ public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , int suspendModeOnCaught , int suspendModeOnUncaught , String [] exceptionTypes ,
156160 String [] classFilters , String [] classExclusionFilters ) {
157161 EventRequestManager manager = vm .eventRequestManager ();
158162
@@ -184,19 +188,7 @@ public void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught
184188 // See org.eclipse.debug.jdi.tests.AbstractJDITest for the example.
185189
186190 if (exceptionTypes == null || exceptionTypes .length == 0 ) {
187- ExceptionRequest request = manager .createExceptionRequest (null , notifyCaught , notifyUncaught );
188- request .setSuspendPolicy (EventRequest .SUSPEND_EVENT_THREAD );
189- if (classFilters != null ) {
190- for (String classFilter : classFilters ) {
191- request .addClassFilter (classFilter );
192- }
193- }
194- if (classExclusionFilters != null ) {
195- for (String exclusionFilter : classExclusionFilters ) {
196- request .addClassExclusionFilter (exclusionFilter );
197- }
198- }
199- request .enable ();
191+ createExceptionBreakpoint (null , notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , classFilters , classExclusionFilters );
200192 return ;
201193 }
202194
@@ -216,27 +208,27 @@ public void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught
216208 && eventRequests .contains (debugEvent .event .request ()))
217209 .subscribe (debugEvent -> {
218210 ClassPrepareEvent event = (ClassPrepareEvent ) debugEvent .event ;
219- createExceptionBreakpoint (event .referenceType (), notifyCaught , notifyUncaught , classFilters , classExclusionFilters );
211+ createExceptionBreakpoint (event .referenceType (), notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , classFilters , classExclusionFilters );
220212 });
221213 subscriptions .add (subscription );
222214
223215 // register exception breakpoint in the loaded classes.
224216 for (ReferenceType refType : vm .classesByName (exceptionType )) {
225- createExceptionBreakpoint (refType , notifyCaught , notifyUncaught , classFilters , classExclusionFilters );
217+ createExceptionBreakpoint (refType , notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , classFilters , classExclusionFilters );
226218 }
227219 }
228220 }
229221 }
230222
231223 @ Override
232- public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , String [] exceptionTypes ,
224+ public void setExceptionBreakpoints (boolean notifyCaught , boolean notifyUncaught , int suspendModeOnCaught , int suspendModeOnUncaught , String [] exceptionTypes ,
233225 String [] classFilters , String [] classExclusionFilters , boolean async ) {
234226 if (async ) {
235227 AsyncJdwpUtils .runAsync (() -> {
236- setExceptionBreakpoints (notifyCaught , notifyUncaught , exceptionTypes , classFilters , classExclusionFilters );
228+ setExceptionBreakpoints (notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , exceptionTypes , classFilters , classExclusionFilters );
237229 });
238230 } else {
239- setExceptionBreakpoints (notifyCaught , notifyUncaught , exceptionTypes , classFilters , classExclusionFilters );
231+ setExceptionBreakpoints (notifyCaught , notifyUncaught , suspendModeOnCaught , suspendModeOnUncaught , exceptionTypes , classFilters , classExclusionFilters );
240232 }
241233 }
242234
@@ -267,10 +259,20 @@ public IMethodBreakpoint createFunctionBreakpoint(String className, String funct
267259 }
268260
269261 private void createExceptionBreakpoint (ReferenceType refType , boolean notifyCaught , boolean notifyUncaught ,
270- String [] classFilters , String [] classExclusionFilters ) {
262+ int suspendModeOnCaught , int suspendModeOnUncaught , String [] classFilters , String [] classExclusionFilters ) {
263+ if (suspendModeOnCaught == suspendModeOnUncaught ) {
264+ createExceptionBreakpoint (refType , notifyCaught , notifyUncaught , suspendModeOnCaught , classFilters , classExclusionFilters );
265+ } else {
266+ createExceptionBreakpoint (refType , notifyCaught , notifyUncaught , suspendModeOnCaught , classFilters , classExclusionFilters );
267+ createExceptionBreakpoint (refType , notifyCaught , notifyUncaught , suspendModeOnUncaught , classFilters , classExclusionFilters );
268+ }
269+ }
270+
271+ private void createExceptionBreakpoint (ReferenceType refType , boolean notifyCaught , boolean notifyUncaught ,
272+ int suspendMode , String [] classFilters , String [] classExclusionFilters ) {
271273 EventRequestManager manager = vm .eventRequestManager ();
272274 ExceptionRequest request = manager .createExceptionRequest (refType , notifyCaught , notifyUncaught );
273- request .setSuspendPolicy (EventRequest . SUSPEND_EVENT_THREAD );
275+ request .setSuspendPolicy (suspendMode );
274276 if (classFilters != null ) {
275277 for (String classFilter : classFilters ) {
276278 request .addClassFilter (classFilter );
0 commit comments