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 300586 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java (-2 / +2 lines)
Lines 115-122 Link Here
115
    
115
    
116
    @Override
116
    @Override
117
    public synchronized void setStatus(IStatus status) {
117
    public synchronized void setStatus(IStatus status) {
118
        if ((getStatus() instanceof MultiStatus)) {
118
        if ((getStatus() instanceof DsfMultiStatus)) {
119
            ((MultiStatus)getStatus()).add(status);
119
            ((DsfMultiStatus)getStatus()).add(status);
120
        }
120
        }
121
    };
121
    };
122
}
122
}
(-)src/org/eclipse/cdt/dsf/concurrent/DsfMultiStatus.java (+67 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Wind River Systems and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Wind River Systems - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.dsf.concurrent;
12
13
import org.eclipse.core.runtime.IStatus;
14
import org.eclipse.core.runtime.MultiStatus;
15
16
/**
17
 * Multi-status that calculates the maximum error code for all children.
18
 * 
19
 * @since 2.1
20
 */
21
public class DsfMultiStatus extends MultiStatus {
22
    
23
    /**
24
     * Creates and returns a new multi-status object with the given children.
25
     *
26
     * @param pluginId the unique identifier of the relevant plug-in
27
     * @param code the plug-in-specific status code
28
     * @param newChildren the list of children status objects
29
     * @param message a human-readable message, localized to the
30
     *    current locale
31
     * @param exception a low-level exception, or <code>null</code> if not
32
     *    applicable 
33
     */
34
    public DsfMultiStatus(String pluginId, int code, IStatus[] newChildren, String message, Throwable exception) {
35
        super(pluginId, code, newChildren, message, exception);
36
    }
37
38
    /**
39
     * Creates and returns a new multi-status object with no children.
40
     *
41
     * @param pluginId the unique identifier of the relevant plug-in
42
     * @param code the plug-in-specific status code
43
     * @param message a human-readable message, localized to the
44
     *    current locale
45
     * @param exception a low-level exception, or <code>null</code> if not
46
     *    applicable 
47
     */
48
    public DsfMultiStatus(String pluginId, int code, String message, Throwable exception) {
49
        super(pluginId, code, message, exception);
50
    }
51
    
52
    @Override
53
    public int getCode() {
54
        IStatus[] children = getChildren();
55
        if (children.length != 0) {
56
            int maxCode = Integer.MIN_VALUE;
57
            for (IStatus status : children) {
58
                if (status.getCode() > maxCode) {
59
                    maxCode = status.getCode();
60
                }
61
            }
62
            return maxCode;
63
        } else {
64
            return super.getCode();
65
        }
66
    }
67
}
(-)src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java (-1 / +2 lines)
Lines 22-27 Link Here
22
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
22
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
23
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
23
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
24
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
24
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
25
import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
25
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
26
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
26
import org.eclipse.cdt.dsf.concurrent.Sequence;
27
import org.eclipse.cdt.dsf.concurrent.Sequence;
27
import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent;
28
import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent;
Lines 419-425 Link Here
419
    													IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB,
420
    													IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB,
420
    													true, null)) {
421
    													true, null)) {
421
    		// If the inferior finishes, let's terminate GDB
422
    		// If the inferior finishes, let's terminate GDB
422
    		terminate(new RequestMonitor(getExecutor(), null));
423
    		terminate(new RequestMonitor(ImmediateExecutor.getInstance(), null));
423
    	}
424
    	}
424
    }
425
    }
425
    
426
    

Return to bug 300586