View | Details | Raw Unified | Return to bug 269306 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java (-15 / +14 lines)
Lines 17-49 Link Here
17
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelText;
17
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelText;
18
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.IStatus;
19
19
20
class ExecutionContextLabelText extends LabelText {
20
/**
21
 * @since 2.0
22
 */
23
public class ExecutionContextLabelText extends LabelText {
21
    
24
    
22
    /**
25
    /**
23
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
26
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
24
     */
27
     */
25
    public static final String PROP_ID_KNOWN = "id_known";  //$NON-NLS-1$
28
    public static final String PROP_STATE_CHANGE_REASON_KNOWN = "state_change_reason_known";  //$NON-NLS-1$
26
29
27
    /**
30
    /**
28
     * A second ID, such as the OS Id for a thread.
29
     * 
30
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
31
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
31
     */
32
     */
32
    public static final String PROP_ID2_KNOWN = "id2_known";  //$NON-NLS-1$
33
    public static final String PROP_ID_KNOWN = "id_known";  //$NON-NLS-1$
33
34
34
    /**
35
    /**
35
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
36
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
36
     */
37
     */
37
    public static final String PROP_NAME_KNOWN = "name_known";  //$NON-NLS-1$
38
    public static final String PROP_NAME_KNOWN = "name_known";  //$NON-NLS-1$
38
    
39
    
39
    protected ExecutionContextLabelText(String formatPattern, String[] propertyNames) {
40
    public ExecutionContextLabelText(String formatPattern, String[] propertyNames) {
40
        super(formatPattern, propertyNames);
41
        super(formatPattern, propertyNames);
41
    }
42
    }
42
    
43
    
43
    @Override
44
    @Override
44
    protected Object getPropertyValue(String propertyName, IStatus status, Map<String, Object> properties) {
45
    protected Object getPropertyValue(String propertyName, IStatus status, Map<String, Object> properties) {
45
        if ( ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) ) {
46
        if ( ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) ) {
46
            String reason = (String)properties.get(propertyName);
47
            String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON);
47
            String reasonLabel = "invalid reason"; //$NON-NLS-1$
48
            String reasonLabel = "invalid reason"; //$NON-NLS-1$
48
            if (StateChangeReason.BREAKPOINT.name().equals(reason)) {
49
            if (StateChangeReason.BREAKPOINT.name().equals(reason)) {
49
                reasonLabel = MessagesForLaunchVM.State_change_reason__Breakpoint__label;
50
                reasonLabel = MessagesForLaunchVM.State_change_reason__Breakpoint__label;
Lines 70-75 Link Here
70
        } else if ( ILaunchVMConstants.PROP_IS_SUSPENDED.equals(propertyName) ) {
71
        } else if ( ILaunchVMConstants.PROP_IS_SUSPENDED.equals(propertyName) ) {
71
            Boolean suspended = (Boolean)properties.get(propertyName);
72
            Boolean suspended = (Boolean)properties.get(propertyName);
72
            return suspended ? 1 : 0;
73
            return suspended ? 1 : 0;
74
        } else if ( PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ) {
75
            String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON);
76
            return (reason != null && !StateChangeReason.UNKNOWN.name().equals(reason)) ? 1 : 0;
73
        } else if (PROP_NAME_KNOWN.equals(propertyName)) {
77
        } else if (PROP_NAME_KNOWN.equals(propertyName)) {
74
            return properties.get(IElementPropertiesProvider.PROP_NAME) != null ? 1 : 0;
78
            return properties.get(IElementPropertiesProvider.PROP_NAME) != null ? 1 : 0;
75
        } else if (IElementPropertiesProvider.PROP_NAME.equals(propertyName)) {
79
        } else if (IElementPropertiesProvider.PROP_NAME.equals(propertyName)) {
Lines 77-90 Link Here
77
            return val != null ? val : "";  //$NON-NLS-1$
81
            return val != null ? val : "";  //$NON-NLS-1$
78
        } else if (PROP_ID_KNOWN.equals(propertyName)) {
82
        } else if (PROP_ID_KNOWN.equals(propertyName)) {
79
            return properties.get(ILaunchVMConstants.PROP_ID) != null ? 1 : 0;
83
            return properties.get(ILaunchVMConstants.PROP_ID) != null ? 1 : 0;
80
        } else if (PROP_ID2_KNOWN.equals(propertyName)) {
81
            return properties.get(ILaunchVMConstants.PROP_ID2) != null ? 1 : 0;
82
        } else if (ILaunchVMConstants.PROP_ID.equals(propertyName)) {
84
        } else if (ILaunchVMConstants.PROP_ID.equals(propertyName)) {
83
            Object val = properties.get(ILaunchVMConstants.PROP_ID);
85
            Object val = properties.get(ILaunchVMConstants.PROP_ID);
84
            return val != null ? val : "";  //$NON-NLS-1$
86
            return val != null ? val : "";  //$NON-NLS-1$
85
        } else if (ILaunchVMConstants.PROP_ID2.equals(propertyName)) {
86
            Object val = properties.get(ILaunchVMConstants.PROP_ID2);
87
            return val != null ? val : "";  //$NON-NLS-1$
88
        }
87
        }
89
        return super.getPropertyValue(propertyName, status, properties);
88
        return super.getPropertyValue(propertyName, status, properties);
90
    }
89
    }
Lines 93-102 Link Here
93
    protected boolean checkProperty(String propertyName, IStatus status, Map<String, Object> properties) {
92
    protected boolean checkProperty(String propertyName, IStatus status, Map<String, Object> properties) {
94
        if (PROP_NAME_KNOWN.equals(propertyName) ||
93
        if (PROP_NAME_KNOWN.equals(propertyName) ||
95
            IElementPropertiesProvider.PROP_NAME.equals(propertyName) ||
94
            IElementPropertiesProvider.PROP_NAME.equals(propertyName) ||
95
            PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ||
96
            ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) ||
96
            PROP_ID_KNOWN.equals(propertyName) ||
97
            PROP_ID_KNOWN.equals(propertyName) ||
97
            ILaunchVMConstants.PROP_ID.equals(propertyName) ||
98
            ILaunchVMConstants.PROP_ID.equals(propertyName)) 
98
            PROP_ID2_KNOWN.equals(propertyName) ||
99
            ILaunchVMConstants.PROP_ID2.equals(propertyName)) 
100
        {
99
        {
101
            return true;
100
            return true;
102
        } 
101
        } 
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java (-1 lines)
Lines 17-23 Link Here
17
public interface ILaunchVMConstants {
17
public interface ILaunchVMConstants {
18
18
19
    public static final String PROP_ID = "id";  //$NON-NLS-1$
19
    public static final String PROP_ID = "id";  //$NON-NLS-1$
20
    public static final String PROP_ID2 = "id2";  //$NON-NLS-1$
21
    
20
    
22
    public static final String PROP_IS_SUSPENDED = "is_suspended";  //$NON-NLS-1$
21
    public static final String PROP_IS_SUSPENDED = "is_suspended";  //$NON-NLS-1$
23
22
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties (-15 / +5 lines)
Lines 26-32 Link Here
26
26
27
# {0} - address 
27
# {0} - address 
28
# {1} - module
28
# {1} - module
29
StackFramesVMNode_No_columns__No_function__text_format=[{1}] at {0}
29
StackFramesVMNode_No_columns__No_function__text_format=[{2}] at {0}
30
30
31
# {0} - address 
31
# {0} - address 
32
# {1} - function 
32
# {1} - function 
Lines 47-66 Link Here
47
# {1} - name
47
# {1} - name
48
# {2} - ID available, 0=not available/1=available
48
# {2} - ID available, 0=not available/1=available
49
# {3} - ID
49
# {3} - ID
50
# {4} - OS Thread ID available, 0=not available/1=available
50
# {4} - 0=running/1=suspended
51
# {5} - OS Thread ID
51
# {5} - state change reason available, 0=not available/1=available
52
# {6} - 0=running/1=suspended
52
# {6} - state change reason
53
# {7} - state change reason
53
AbstractThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]} ({4,choice,0#Running|1#Suspended}{5,choice,0#|1# : {6}})
54
AbstractThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]}{4,choice,0#|1# {5}} ({6,choice,0#Running|1#Suspended} : {7})
55
56
# {0} - name available, 0=not available/1=available
57
# {1} - name
58
# {2} - ID available, 0=not available/1=available
59
# {3} - ID
60
# {4} - OS Thread ID available, 0=not available/1=available
61
# {5} - OS Thread ID
62
# {6} - 0=running/1=suspended
63
AbstractThreadVMNode_No_columns__No_reason__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]}{4,choice,0#|1# {5}} ({6,choice,0#Running|1#Suspended})
64
54
65
AbstractThreadVMNode_No_columns__Error__label=<unavailable>
55
AbstractThreadVMNode_No_columns__Error__label=<unavailable>
66
56
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java (-24 / +2 lines)
Lines 12-18 Link Here
12
package org.eclipse.cdt.dsf.debug.ui.viewmodel.launch;
12
package org.eclipse.cdt.dsf.debug.ui.viewmodel.launch;
13
13
14
import java.util.List;
14
import java.util.List;
15
import java.util.Map;
16
import java.util.concurrent.RejectedExecutionException;
15
import java.util.concurrent.RejectedExecutionException;
17
16
18
import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor;
17
import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor;
Lines 105-134 Link Here
105
                        PROP_NAME, 
104
                        PROP_NAME, 
106
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
105
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
107
                        ILaunchVMConstants.PROP_ID, 
106
                        ILaunchVMConstants.PROP_ID, 
108
                        ExecutionContextLabelText.PROP_ID2_KNOWN, 
109
                        ILaunchVMConstants.PROP_ID2, 
110
                        ILaunchVMConstants.PROP_IS_SUSPENDED, 
107
                        ILaunchVMConstants.PROP_IS_SUSPENDED, 
111
                        ILaunchVMConstants.PROP_STATE_CHANGE_REASON })
108
                        ExecutionContextLabelText.PROP_STATE_CHANGE_REASON_KNOWN, 
112
                {
109
                        ILaunchVMConstants.PROP_STATE_CHANGE_REASON }),
113
                    @Override
114
                    public boolean isEnabled(IStatus status, Map<String, Object> properties) {
115
                        String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON);
116
                        return 
117
                            reason != null && reason.length() != 0 && 
118
                            !StateChangeReason.UNKNOWN.equals(reason);
119
                    }
120
                },
121
                // If no state change reason is available compose a string without it. 
122
                new ExecutionContextLabelText(
123
                    MessagesForLaunchVM.AbstractThreadVMNode_No_columns__No_reason__text_format,
124
                    new String[] { 
125
                        ExecutionContextLabelText.PROP_NAME_KNOWN, 
126
                        PROP_NAME, 
127
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
128
                        ILaunchVMConstants.PROP_ID, 
129
                        ExecutionContextLabelText.PROP_ID2_KNOWN, 
130
                        ILaunchVMConstants.PROP_ID2, 
131
                        ILaunchVMConstants.PROP_IS_SUSPENDED }), 
132
                new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]),
110
                new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]),
133
                new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {
111
                new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {
134
                    { setPropertyNames(new String[] { ILaunchVMConstants.PROP_IS_SUSPENDED }); }
112
                    { setPropertyNames(new String[] { ILaunchVMConstants.PROP_IS_SUSPENDED }); }
(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java (-30 / +71 lines)
Lines 18-23 Link Here
18
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext;
18
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext;
19
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData;
19
import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData;
20
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractThreadVMNode;
20
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractThreadVMNode;
21
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ExecutionContextLabelText;
21
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ILaunchVMConstants;
22
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ILaunchVMConstants;
22
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
23
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
23
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
24
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
Lines 27-37 Link Here
27
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
28
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
28
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
29
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
29
import org.eclipse.cdt.dsf.ui.viewmodel.properties.IPropertiesUpdate;
30
import org.eclipse.cdt.dsf.ui.viewmodel.properties.IPropertiesUpdate;
31
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelAttribute;
32
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelColumnInfo;
33
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelImage;
34
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelText;
35
import org.eclipse.cdt.dsf.ui.viewmodel.properties.PropertiesBasedLabelProvider;
30
import org.eclipse.cdt.dsf.ui.viewmodel.properties.VMDelegatingPropertiesUpdate;
36
import org.eclipse.cdt.dsf.ui.viewmodel.properties.VMDelegatingPropertiesUpdate;
37
import org.eclipse.core.runtime.IStatus;
31
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
38
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
32
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
39
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
33
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
40
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
34
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
41
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
42
import org.eclipse.debug.ui.DebugUITools;
43
import org.eclipse.debug.ui.IDebugUIConstants;
35
import org.eclipse.ui.IMemento;
44
import org.eclipse.ui.IMemento;
36
45
37
46
Lines 49-54 Link Here
49
    }
58
    }
50
    
59
    
51
    @Override
60
    @Override
61
    protected IElementLabelProvider createLabelProvider() {
62
        PropertiesBasedLabelProvider provider = new PropertiesBasedLabelProvider();
63
64
        provider.setColumnInfo(
65
            PropertiesBasedLabelProvider.ID_COLUMN_NO_COLUMNS, 
66
            new LabelColumnInfo(new LabelAttribute[] { 
67
                // Text is made of the thread name followed by its state and state change reason. 
68
                new GdbExecutionContextLabelText(
69
                    MessagesForGdbLaunchVM.ThreadVMNode_No_columns__text_format,
70
                    new String[] { 
71
                        ExecutionContextLabelText.PROP_NAME_KNOWN, 
72
                        PROP_NAME, 
73
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
74
                        ILaunchVMConstants.PROP_ID, 
75
                        IGdbLaunchVMConstants.PROP_OS_ID_KNOWN, 
76
                        IGdbLaunchVMConstants.PROP_OS_ID, 
77
                        ILaunchVMConstants.PROP_IS_SUSPENDED, 
78
                        ExecutionContextLabelText.PROP_STATE_CHANGE_REASON_KNOWN, 
79
                        ILaunchVMConstants.PROP_STATE_CHANGE_REASON }),
80
                new LabelText(MessagesForGdbLaunchVM.ThreadVMNode_No_columns__Error__label, new String[0]),
81
                new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {
82
                    { setPropertyNames(new String[] { ILaunchVMConstants.PROP_IS_SUSPENDED }); }
83
                    
84
                    @Override
85
                    public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
86
                        return !((Boolean)properties.get(ILaunchVMConstants.PROP_IS_SUSPENDED)).booleanValue();
87
                    };
88
                },
89
                new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED)),
90
            }));
91
        return provider;
92
    }
93
94
    @Override
52
    protected void updatePropertiesInSessionThread(IPropertiesUpdate[] updates) {
95
    protected void updatePropertiesInSessionThread(IPropertiesUpdate[] updates) {
53
        IPropertiesUpdate[] parentUpdates = new IPropertiesUpdate[updates.length]; 
96
        IPropertiesUpdate[] parentUpdates = new IPropertiesUpdate[updates.length]; 
54
        
97
        
Lines 63-95 Link Here
63
            // standard container properties.
106
            // standard container properties.
64
            parentUpdates[i] = new VMDelegatingPropertiesUpdate(updates[i], countringRm);
107
            parentUpdates[i] = new VMDelegatingPropertiesUpdate(updates[i], countringRm);
65
            count++;
108
            count++;
66
            
109
110
            IMIExecutionDMContext execDmc = findDmcInPath(
111
                update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
112
            if (execDmc != null) {
113
                update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId()));
114
            }
115
67
            IProcesses processService = getServicesTracker().getService(IProcesses.class);
116
            IProcesses processService = getServicesTracker().getService(IProcesses.class);
68
            final IThreadDMContext threadDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class);
117
            final IThreadDMContext threadDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class);
69
            
118
            
70
            if (processService == null || threadDmc == null) {
119
            if (update.getProperties().contains(PROP_NAME) || 
71
                update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); //$NON-NLS-1$
120
                update.getProperties().contains(IGdbLaunchVMConstants.PROP_OS_ID)) 
72
            } else {
121
            {
73
                processService.getExecutionData(
122
                // 
74
                	threadDmc,
123
                if (processService == null || threadDmc == null) {
75
                    new ViewerDataRequestMonitor<IThreadDMData>(getExecutor(), update) {
124
                    update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); //$NON-NLS-1$
76
                        @Override
125
                } else {
77
                        public void handleCompleted() {
126
                    processService.getExecutionData(
78
                            if (isSuccess()) {
127
                    	threadDmc,
79
                                fillThreadDataProperties(update, getData());
128
                        new ViewerDataRequestMonitor<IThreadDMData>(getExecutor(), update) {
80
                            } else {
129
                            @Override
81
                                final IMIExecutionDMContext execDmc = findDmcInPath(
130
                            public void handleCompleted() {
82
                                    update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
131
                                if (isSuccess()) {
83
                                if (execDmc != null) {
132
                                    fillThreadDataProperties(update, getData());
84
                                    update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId()));
133
                                } 
85
                                } else {
134
                                update.setStatus(getStatus());
86
                                    update.setStatus(getStatus());
135
                                countringRm.done();
87
                                }
88
                            }
136
                            }
89
                            countringRm.done();
137
                        });
90
                        }
138
                    count++;
91
                    });
139
                }
92
                count++;
93
            }
140
            }
94
            
141
            
95
            countringRm.setDoneCount(count);
142
            countringRm.setDoneCount(count);
Lines 101-113 Link Here
101
    	if (data.getName() != null && data.getName().length() > 0) {
148
    	if (data.getName() != null && data.getName().length() > 0) {
102
    		update.setProperty(PROP_NAME, data.getName());
149
    		update.setProperty(PROP_NAME, data.getName());
103
    	}
150
    	}
104
    	
151
        update.setProperty(IGdbLaunchVMConstants.PROP_OS_ID, data.getId());
105
        IMIExecutionDMContext execDmc = findDmcInPath(
106
                update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
107
        if (execDmc != null) {
108
            update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId()));
109
        }
110
        update.setProperty(ILaunchVMConstants.PROP_ID2, data.getId());
111
    }
152
    }
112
153
113
	private String produceThreadElementName(String viewName, IMIExecutionDMContext execCtx) {
154
	private String produceThreadElementName(String viewName, IMIExecutionDMContext execCtx) {
(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/MessagesForGdbLaunchVM.java (+33 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
12
package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.launch;
13
14
import org.eclipse.osgi.util.NLS;
15
16
/**
17
 * @noinstantiate This class is not intended to be instantiated by clients.
18
 */
19
public class MessagesForGdbLaunchVM extends NLS {
20
    private static final String BUNDLE_NAME = "org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.launch.messages"; //$NON-NLS-1$
21
22
    static {
23
        // initialize resource bundle
24
        NLS.initializeMessages(BUNDLE_NAME, MessagesForGdbLaunchVM.class);
25
    }
26
27
    private MessagesForGdbLaunchVM() {
28
    }
29
30
    public static String ThreadVMNode_No_columns__text_format;
31
    public static String ThreadVMNode_No_columns__No_reason__text_format;
32
    public static String ThreadVMNode_No_columns__Error__label;
33
}
(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbExecutionContextLabelText.java (+44 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.gdb.internal.ui.viewmodel.launch;
12
13
import java.util.Map;
14
15
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ExecutionContextLabelText;
16
import org.eclipse.core.runtime.IStatus;
17
18
/**
19
 * @since 2.0
20
 */
21
public class GdbExecutionContextLabelText extends ExecutionContextLabelText {
22
23
    public GdbExecutionContextLabelText(String formatPattern, String[] propertyNames) {
24
        super(formatPattern, propertyNames);
25
    }
26
27
    @Override
28
    protected Object getPropertyValue(String propertyName, IStatus status, Map<String, Object> properties) {
29
        if (IGdbLaunchVMConstants.PROP_OS_ID_KNOWN.equals(propertyName)) {
30
            return properties.get(IGdbLaunchVMConstants.PROP_OS_ID) != null ? 1 : 0;
31
        } 
32
        return super.getPropertyValue(propertyName, status, properties);
33
    }
34
35
    @Override
36
    protected boolean checkProperty(String propertyName, IStatus status, Map<String, Object> properties) {
37
        if (IGdbLaunchVMConstants.PROP_OS_ID_KNOWN.equals(propertyName) ||
38
            IGdbLaunchVMConstants.PROP_OS_ID.equals(propertyName)) 
39
        {
40
            return true;
41
        } 
42
        return super.checkProperty(propertyName, status, properties);
43
    }
44
}
(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/messages.properties (+24 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2007, 2009 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
12
# {0} - name available, 0=not available/1=available
13
# {1} - name
14
# {2} - ID available, 0=not available/1=available
15
# {3} - ID
16
# {4} - OS Thread ID available, 0=not available/1=available
17
# {5} - OS Thread ID
18
# {6} - 0=running/1=suspended
19
# {7} - state change reason available, 0=not available/1=available
20
# {8} - state change reason
21
ThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]}{4,choice,0#|1# {5}} ({6,choice,0#Running|1#Suspended}{7,choice,0#|1# : {8}})
22
23
ThreadVMNode_No_columns__Error__label=<unavailable>
24
(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/IGdbLaunchVMConstants.java (+26 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.gdb.internal.ui.viewmodel.launch;
12
13
/**
14
 * @since 2.0
15
 */
16
public interface IGdbLaunchVMConstants {
17
18
    public static final String PROP_OS_ID = "os_id";  //$NON-NLS-1$
19
20
    /**
21
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
22
     */
23
    public static final String PROP_OS_ID_KNOWN = "os_id_known";  //$NON-NLS-1$
24
25
    
26
}

Return to bug 269306