Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 282924
Collapse All | Expand All

(-)src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java (-5 / +18 lines)
Lines 578-583 Link Here
578
                        // Reset the thread (is it necessary?)
578
                        // Reset the thread (is it necessary?)
579
                        attributes.put(ATTR_THREAD_ID, NULL_STRING);
579
                        attributes.put(ATTR_THREAD_ID, NULL_STRING);
580
580
581
                        // Remove breakpoint problem marker (if any)
582
                        removeBreakpointProblemMarker(breakpoint);
583
581
                        // Finally, update the platform breakpoint
584
                        // Finally, update the platform breakpoint
582
                        try {
585
                        try {
583
							breakpoint.incrementInstallCount();
586
							breakpoint.incrementInstallCount();
Lines 777-782 Link Here
777
        }
780
        }
778
781
779
        // Check if the breakpoint is installed: it might not have been if it wasn't enabled at startup (Bug261082)
782
        // Check if the breakpoint is installed: it might not have been if it wasn't enabled at startup (Bug261082)
783
        // Or the installation might have failed; in this case, we still try to install it again because
784
        // some attribute might have changed which will make the install succeed.
780
        if (!breakpointIDs.containsKey(breakpoint) && !targetBPs.containsValue(breakpoint)) {
785
        if (!breakpointIDs.containsKey(breakpoint) && !targetBPs.containsValue(breakpoint)) {
781
        	// Install only if the breakpoint is enabled
786
        	// Install only if the breakpoint is enabled
782
        	boolean bpEnabled = attributes.get(ICBreakpoint.ENABLED).equals(true) && fBreakpointManager.isEnabled();
787
        	boolean bpEnabled = attributes.get(ICBreakpoint.ENABLED).equals(true) && fBreakpointManager.isEnabled();
Lines 787-793 Link Here
787
                determineDebuggerPath(dmc, attributes, new RequestMonitor(getExecutor(), rm) {
792
                determineDebuggerPath(dmc, attributes, new RequestMonitor(getExecutor(), rm) {
788
                    @Override
793
                    @Override
789
                    protected void handleSuccess() {
794
                    protected void handleSuccess() {
790
                      	installBreakpoint(dmc, breakpoint, attributes, new RequestMonitor(getExecutor(), rm));
795
                      	installBreakpoint(dmc, breakpoint, attributes, rm);
791
                    }
796
                    }
792
                });
797
                });
793
        	}
798
        	}
Lines 1282-1288 Link Here
1282
    	// Reset the breakpoint install count
1287
    	// Reset the breakpoint install count
1283
    	for (IBreakpointsTargetDMContext ctx : fPlatformBPs.keySet()) {
1288
    	for (IBreakpointsTargetDMContext ctx : fPlatformBPs.keySet()) {
1284
    		Map<ICBreakpoint, Map<String, Object>> breakpoints = fPlatformBPs.get(ctx);
1289
    		Map<ICBreakpoint, Map<String, Object>> breakpoints = fPlatformBPs.get(ctx);
1285
            clearBreakpointStatus(breakpoints.keySet().toArray(new ICBreakpoint[breakpoints.size()]));
1290
            clearBreakpointStatus(breakpoints.keySet().toArray(new ICBreakpoint[breakpoints.size()]), ctx);
1286
    	}
1291
    	}
1287
    	// This will prevent Shutdown() from trying to remove bps from a
1292
    	// This will prevent Shutdown() from trying to remove bps from a
1288
    	// backend that has already shutdown
1293
    	// backend that has already shutdown
Lines 1296-1310 Link Here
1296
    /**
1301
    /**
1297
     * @param bps
1302
     * @param bps
1298
     */
1303
     */
1299
    private void clearBreakpointStatus(final ICBreakpoint[] bps)
1304
    private void clearBreakpointStatus(final ICBreakpoint[] bps, final IBreakpointsTargetDMContext ctx)
1300
    {
1305
    {
1301
        new Job("Clear Breakpoints Status") { //$NON-NLS-1$
1306
        new Job("Clear Breakpoints Status") { //$NON-NLS-1$
1302
            @Override
1307
            @Override
1303
            protected IStatus run(IProgressMonitor monitor) {
1308
            protected IStatus run(IProgressMonitor monitor) {
1304
                IWorkspaceRunnable wr = new IWorkspaceRunnable() {
1309
                IWorkspaceRunnable wr = new IWorkspaceRunnable() {
1305
                    public void run(IProgressMonitor monitor) throws CoreException {
1310
                    public void run(IProgressMonitor monitor) throws CoreException {
1306
                        for (ICBreakpoint breakpoint : bps) {
1311
                    	// For every platform breakpoint that has at least one target breakpoint installed
1307
                        	breakpoint.resetInstallCount();
1312
                    	// we must decrement the install count, for every target breakpoint.
1313
                    	// Note that we cannot simply call resetInstallCount() because another
1314
                    	// launch may be using the same platform breakpoint.
1315
                    	Map<ICBreakpoint, Vector<IBreakpointDMContext>> breakpoints = fBreakpointIDs.get(ctx);
1316
                    	for (ICBreakpoint breakpoint : breakpoints.keySet()) {
1317
                    		Vector<IBreakpointDMContext> targetBps = breakpoints.get(breakpoint);
1318
                    		for (int i=0; i<targetBps.size(); i++) {
1319
                    			breakpoint.decrementInstallCount();
1320
                    		}
1308
                        }
1321
                        }
1309
                    }
1322
                    }
1310
                };
1323
                };

Return to bug 282924