mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 06:55:23 +02:00
[269306] Fix ThreadVMNode to display as we used to.
This commit is contained in:
parent
c7b848e69f
commit
5ae5f6b33a
5 changed files with 40 additions and 11 deletions
|
@ -15,7 +15,7 @@ import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants;
|
|||
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 @@ public class ThreadVMNode extends AbstractThreadVMNode
|
|||
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<IThreadDMData>(getExecutor(), update) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
|
@ -98,8 +98,16 @@ public class ThreadVMNode extends AbstractThreadVMNode
|
|||
}
|
||||
|
||||
protected void fillThreadDataProperties(IPropertiesUpdate update, IThreadDMData data) {
|
||||
if (data.getName() != null && data.getName().length() > 0) {
|
||||
update.setProperty(PROP_NAME, data.getName());
|
||||
update.setProperty(ILaunchVMConstants.PROP_ID, data.getId());
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -105,6 +105,8 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode
|
|||
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 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode
|
|||
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)) {
|
||||
|
|
|
@ -24,6 +24,13 @@ class ExecutionContextLabelText extends LabelText {
|
|||
*/
|
||||
public static final String PROP_ID_KNOWN = "id_known"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* A second ID, such as the OS Id for a thread.
|
||||
*
|
||||
* Value <code>0</code> means it's not known. Value <code>1</code>, means it's known.
|
||||
*/
|
||||
public static final String PROP_ID2_KNOWN = "id2_known"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Value <code>0</code> means it's not known. Value <code>1</code>, means it's known.
|
||||
*/
|
||||
|
@ -70,9 +77,14 @@ class ExecutionContextLabelText extends LabelText {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.eclipse.cdt.dsf.debug.ui.viewmodel.launch;
|
|||
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$
|
||||
|
||||
|
|
|
@ -47,16 +47,20 @@ AbstractContainerVMNode_No_columns__Error__label=<unavailable>
|
|||
# {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=<unavailable>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue