### Eclipse Workspace Patch 1.0 #P org.eclipse.cdt.dsf.gdb.ui Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java,v retrieving revision 1.2 diff -u -r1.2 ThreadVMNode.java --- src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java 10 Mar 2009 23:47:17 -0000 1.2 +++ src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/ThreadVMNode.java 19 Mar 2009 01:54:54 -0000 @@ -15,7 +15,7 @@ import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor; import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.debug.service.IProcesses; -import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext; +import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext; import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData; import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractThreadVMNode; import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ILaunchVMConstants; @@ -65,13 +65,13 @@ count++; IProcesses processService = getServicesTracker().getService(IProcesses.class); - final IProcessDMContext procDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IProcessDMContext.class); + final IThreadDMContext threadDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class); - if (processService == null || procDmc == null) { + if (processService == null || threadDmc == null) { update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); //$NON-NLS-1$ } else { processService.getExecutionData( - procDmc, + threadDmc, new ViewerDataRequestMonitor(getExecutor(), update) { @Override public void handleCompleted() { @@ -98,8 +98,16 @@ } protected void fillThreadDataProperties(IPropertiesUpdate update, IThreadDMData data) { - update.setProperty(PROP_NAME, data.getName()); - update.setProperty(ILaunchVMConstants.PROP_ID, data.getId()); + if (data.getName() != null && data.getName().length() > 0) { + update.setProperty(PROP_NAME, data.getName()); + } + + IMIExecutionDMContext execDmc = findDmcInPath( + update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class); + if (execDmc != null) { + update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId())); + } + update.setProperty(ILaunchVMConstants.PROP_ID2, data.getId()); } private String produceThreadElementName(String viewName, IMIExecutionDMContext execCtx) { #P org.eclipse.cdt.dsf.ui Index: src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java,v retrieving revision 1.1 diff -u -r1.1 ExecutionContextLabelText.java --- src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java 10 Mar 2009 23:47:13 -0000 1.1 +++ src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java 19 Mar 2009 01:54:55 -0000 @@ -25,6 +25,13 @@ public static final String PROP_ID_KNOWN = "id_known"; //$NON-NLS-1$ /** + * A second ID, such as the OS Id for a thread. + * + * Value 0 means it's not known. Value 1, means it's known. + */ + public static final String PROP_ID2_KNOWN = "id2_known"; //$NON-NLS-1$ + + /** * Value 0 means it's not known. Value 1, means it's known. */ public static final String PROP_NAME_KNOWN = "name_known"; //$NON-NLS-1$ @@ -70,9 +77,14 @@ return val != null ? val : ""; //$NON-NLS-1$ } else if (PROP_ID_KNOWN.equals(propertyName)) { return properties.get(ILaunchVMConstants.PROP_ID) != null ? 1 : 0; + } else if (PROP_ID2_KNOWN.equals(propertyName)) { + return properties.get(ILaunchVMConstants.PROP_ID2) != null ? 1 : 0; } else if (ILaunchVMConstants.PROP_ID.equals(propertyName)) { Object val = properties.get(ILaunchVMConstants.PROP_ID); return val != null ? val : ""; //$NON-NLS-1$ + } else if (ILaunchVMConstants.PROP_ID2.equals(propertyName)) { + Object val = properties.get(ILaunchVMConstants.PROP_ID2); + return val != null ? val : ""; //$NON-NLS-1$ } return super.getPropertyValue(propertyName, status, properties); } Index: src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java,v retrieving revision 1.1 diff -u -r1.1 ILaunchVMConstants.java --- src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java 10 Mar 2009 23:47:13 -0000 1.1 +++ src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java 19 Mar 2009 01:54:55 -0000 @@ -17,6 +17,7 @@ public interface ILaunchVMConstants { public static final String PROP_ID = "id"; //$NON-NLS-1$ + public static final String PROP_ID2 = "id2"; //$NON-NLS-1$ public static final String PROP_IS_SUSPENDED = "is_suspended"; //$NON-NLS-1$ Index: src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties =================================================================== RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties,v retrieving revision 1.3 diff -u -r1.3 messages.properties --- src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties 18 Mar 2009 19:45:50 -0000 1.3 +++ src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties 19 Mar 2009 01:54:55 -0000 @@ -47,16 +47,20 @@ # {1} - name # {2} - ID available, 0=not available/1=available # {3} - ID -# {4} - 0=running/1=suspended -# {5} - state change reason -AbstractThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]} ({4,choice,0#Running|1#Suspended} : {5}) +# {4} - OS Thread ID available, 0=not available/1=available +# {5} - OS Thread ID +# {6} - 0=running/1=suspended +# {7} - state change reason +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}) # {0} - name available, 0=not available/1=available # {1} - name # {2} - ID available, 0=not available/1=available # {3} - ID -# {4} - 0=running/1=suspended -AbstractThreadVMNode_No_columns__No_reason__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]} ({4,choice,0#Running|1#Suspended}) +# {4} - OS Thread ID available, 0=not available/1=available +# {5} - OS Thread ID +# {6} - 0=running/1=suspended +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}) AbstractThreadVMNode_No_columns__Error__label= Index: src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java,v retrieving revision 1.5 diff -u -r1.5 AbstractThreadVMNode.java --- src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java 18 Mar 2009 15:24:12 -0000 1.5 +++ src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java 19 Mar 2009 01:54:55 -0000 @@ -105,6 +105,8 @@ PROP_NAME, ExecutionContextLabelText.PROP_ID_KNOWN, ILaunchVMConstants.PROP_ID, + ExecutionContextLabelText.PROP_ID2_KNOWN, + ILaunchVMConstants.PROP_ID2, ILaunchVMConstants.PROP_IS_SUSPENDED, ILaunchVMConstants.PROP_STATE_CHANGE_REASON }) { @@ -124,6 +126,8 @@ PROP_NAME, ExecutionContextLabelText.PROP_ID_KNOWN, ILaunchVMConstants.PROP_ID, + ExecutionContextLabelText.PROP_ID2_KNOWN, + ILaunchVMConstants.PROP_ID2, ILaunchVMConstants.PROP_IS_SUSPENDED }), new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]), new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {