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

Collapse All | Expand All

(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java (-6 / +14 lines)
Lines 15-21 Link Here
15
import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
15
import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
16
import org.eclipse.cdt.dsf.datamodel.IDMContext;
16
import org.eclipse.cdt.dsf.datamodel.IDMContext;
17
import org.eclipse.cdt.dsf.debug.service.IProcesses;
17
import org.eclipse.cdt.dsf.debug.service.IProcesses;
18
import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext;
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.ILaunchVMConstants;
21
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ILaunchVMConstants;
Lines 65-77 Link Here
65
            count++;
65
            count++;
66
            
66
            
67
            IProcesses processService = getServicesTracker().getService(IProcesses.class);
67
            IProcesses processService = getServicesTracker().getService(IProcesses.class);
68
            final IProcessDMContext procDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IProcessDMContext.class);
68
            final IThreadDMContext threadDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class);
69
            
69
            
70
            if (processService == null || procDmc == null) {
70
            if (processService == null || threadDmc == null) {
71
                update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); //$NON-NLS-1$
71
                update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); //$NON-NLS-1$
72
            } else {
72
            } else {
73
                processService.getExecutionData(
73
                processService.getExecutionData(
74
                    procDmc,
74
                	threadDmc,
75
                    new ViewerDataRequestMonitor<IThreadDMData>(getExecutor(), update) {
75
                    new ViewerDataRequestMonitor<IThreadDMData>(getExecutor(), update) {
76
                        @Override
76
                        @Override
77
                        public void handleCompleted() {
77
                        public void handleCompleted() {
Lines 98-105 Link Here
98
    }
98
    }
99
    
99
    
100
    protected void fillThreadDataProperties(IPropertiesUpdate update, IThreadDMData data) {
100
    protected void fillThreadDataProperties(IPropertiesUpdate update, IThreadDMData data) {
101
        update.setProperty(PROP_NAME, data.getName());
101
    	if (data.getName() != null && data.getName().length() > 0) {
102
        update.setProperty(ILaunchVMConstants.PROP_ID, data.getId());
102
    		update.setProperty(PROP_NAME, data.getName());
103
    	}
104
    	
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());
103
    }
111
    }
104
112
105
	private String produceThreadElementName(String viewName, IMIExecutionDMContext execCtx) {
113
	private String produceThreadElementName(String viewName, IMIExecutionDMContext execCtx) {
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java (+12 lines)
Lines 25-30 Link Here
25
    public static final String PROP_ID_KNOWN = "id_known";  //$NON-NLS-1$
25
    public static final String PROP_ID_KNOWN = "id_known";  //$NON-NLS-1$
26
26
27
    /**
27
    /**
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
     */
32
    public static final String PROP_ID2_KNOWN = "id2_known";  //$NON-NLS-1$
33
34
    /**
28
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
35
     * Value <code>0</code> means it's not known.  Value <code>1</code>, means it's known.
29
     */
36
     */
30
    public static final String PROP_NAME_KNOWN = "name_known";  //$NON-NLS-1$
37
    public static final String PROP_NAME_KNOWN = "name_known";  //$NON-NLS-1$
Lines 70-78 Link Here
70
            return val != null ? val : "";  //$NON-NLS-1$
77
            return val != null ? val : "";  //$NON-NLS-1$
71
        } else if (PROP_ID_KNOWN.equals(propertyName)) {
78
        } else if (PROP_ID_KNOWN.equals(propertyName)) {
72
            return properties.get(ILaunchVMConstants.PROP_ID) != null ? 1 : 0;
79
            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;
73
        } else if (ILaunchVMConstants.PROP_ID.equals(propertyName)) {
82
        } else if (ILaunchVMConstants.PROP_ID.equals(propertyName)) {
74
            Object val = properties.get(ILaunchVMConstants.PROP_ID);
83
            Object val = properties.get(ILaunchVMConstants.PROP_ID);
75
            return val != null ? val : "";  //$NON-NLS-1$
84
            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$
76
        }
88
        }
77
        return super.getPropertyValue(propertyName, status, properties);
89
        return super.getPropertyValue(propertyName, status, properties);
78
    }
90
    }
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java (+1 lines)
Lines 17-22 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$
20
    
21
    
21
    public static final String PROP_IS_SUSPENDED = "is_suspended";  //$NON-NLS-1$
22
    public static final String PROP_IS_SUSPENDED = "is_suspended";  //$NON-NLS-1$
22
23
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties (-5 / +9 lines)
Lines 47-62 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} - 0=running/1=suspended
50
# {4} - OS Thread ID available, 0=not available/1=available
51
# {5} - state change reason
51
# {5} - OS Thread ID
52
AbstractThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]} ({4,choice,0#Running|1#Suspended} : {5})
52
# {6} - 0=running/1=suspended
53
# {7} - state change reason
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})
53
55
54
# {0} - name available, 0=not available/1=available
56
# {0} - name available, 0=not available/1=available
55
# {1} - name
57
# {1} - name
56
# {2} - ID available, 0=not available/1=available
58
# {2} - ID available, 0=not available/1=available
57
# {3} - ID
59
# {3} - ID
58
# {4} - 0=running/1=suspended
60
# {4} - OS Thread ID available, 0=not available/1=available
59
AbstractThreadVMNode_No_columns__No_reason__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]} ({4,choice,0#Running|1#Suspended})
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})
60
64
61
AbstractThreadVMNode_No_columns__Error__label=<unavailable>
65
AbstractThreadVMNode_No_columns__Error__label=<unavailable>
62
66
(-)src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java (+4 lines)
Lines 105-110 Link Here
105
                        PROP_NAME, 
105
                        PROP_NAME, 
106
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
106
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
107
                        ILaunchVMConstants.PROP_ID, 
107
                        ILaunchVMConstants.PROP_ID, 
108
                        ExecutionContextLabelText.PROP_ID2_KNOWN, 
109
                        ILaunchVMConstants.PROP_ID2, 
108
                        ILaunchVMConstants.PROP_IS_SUSPENDED, 
110
                        ILaunchVMConstants.PROP_IS_SUSPENDED, 
109
                        ILaunchVMConstants.PROP_STATE_CHANGE_REASON })
111
                        ILaunchVMConstants.PROP_STATE_CHANGE_REASON })
110
                {
112
                {
Lines 124-129 Link Here
124
                        PROP_NAME, 
126
                        PROP_NAME, 
125
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
127
                        ExecutionContextLabelText.PROP_ID_KNOWN, 
126
                        ILaunchVMConstants.PROP_ID, 
128
                        ILaunchVMConstants.PROP_ID, 
129
                        ExecutionContextLabelText.PROP_ID2_KNOWN, 
130
                        ILaunchVMConstants.PROP_ID2, 
127
                        ILaunchVMConstants.PROP_IS_SUSPENDED }), 
131
                        ILaunchVMConstants.PROP_IS_SUSPENDED }), 
128
                new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]),
132
                new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]),
129
                new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {
133
                new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {

Return to bug 269306