mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 288962 - [debug view] Extend IExecutionDMData to retrieve details about state change reason
This commit is contained in:
parent
05512ba623
commit
ee3801c51f
6 changed files with 52 additions and 2 deletions
|
@ -28,6 +28,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerResumedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerSuspendedDMEvent;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerSuspendedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMData;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMData;
|
||||||
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMData2;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExitedDMEvent;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExitedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IStartedDMEvent;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IStartedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
||||||
|
@ -177,6 +178,13 @@ public abstract class AbstractContainerVMNode extends AbstractDMVMNode
|
||||||
if (reason != null) {
|
if (reason != null) {
|
||||||
update.setProperty(ILaunchVMConstants.PROP_STATE_CHANGE_REASON, data.getStateChangeReason().name());
|
update.setProperty(ILaunchVMConstants.PROP_STATE_CHANGE_REASON, data.getStateChangeReason().name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data instanceof IExecutionDMData2) {
|
||||||
|
String details = ((IExecutionDMData2)data).getDetails();
|
||||||
|
if (details != null) {
|
||||||
|
update.setProperty(ILaunchVMConstants.PROP_STATE_CHANGE_DETAILS, details);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerResumedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerSuspendedDMEvent;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerSuspendedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMData;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMData;
|
||||||
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMData2;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IResumedDMEvent;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IResumedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
||||||
|
@ -107,7 +108,9 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode
|
||||||
ILaunchVMConstants.PROP_ID,
|
ILaunchVMConstants.PROP_ID,
|
||||||
ILaunchVMConstants.PROP_IS_SUSPENDED,
|
ILaunchVMConstants.PROP_IS_SUSPENDED,
|
||||||
ExecutionContextLabelText.PROP_STATE_CHANGE_REASON_KNOWN,
|
ExecutionContextLabelText.PROP_STATE_CHANGE_REASON_KNOWN,
|
||||||
ILaunchVMConstants.PROP_STATE_CHANGE_REASON }),
|
ILaunchVMConstants.PROP_STATE_CHANGE_REASON,
|
||||||
|
ExecutionContextLabelText.PROP_STATE_CHANGE_DETAILS_KNOWN,
|
||||||
|
ILaunchVMConstants.PROP_STATE_CHANGE_DETAILS }),
|
||||||
new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]),
|
new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]),
|
||||||
new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {
|
new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) {
|
||||||
{ setPropertyNames(new String[] { ILaunchVMConstants.PROP_IS_SUSPENDED }); }
|
{ setPropertyNames(new String[] { ILaunchVMConstants.PROP_IS_SUSPENDED }); }
|
||||||
|
@ -208,6 +211,13 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode
|
||||||
if (reason != null) {
|
if (reason != null) {
|
||||||
update.setProperty(ILaunchVMConstants.PROP_STATE_CHANGE_REASON, data.getStateChangeReason().name());
|
update.setProperty(ILaunchVMConstants.PROP_STATE_CHANGE_REASON, data.getStateChangeReason().name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data instanceof IExecutionDMData2) {
|
||||||
|
String details = ((IExecutionDMData2)data).getDetails();
|
||||||
|
if (details != null) {
|
||||||
|
update.setProperty(ILaunchVMConstants.PROP_STATE_CHANGE_DETAILS, details);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,12 @@ public class ExecutionContextLabelText extends LabelText {
|
||||||
*/
|
*/
|
||||||
public static final String PROP_STATE_CHANGE_REASON_KNOWN = "state_change_reason_known"; //$NON-NLS-1$
|
public static final String PROP_STATE_CHANGE_REASON_KNOWN = "state_change_reason_known"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value <code>0</code> means it's not known. Value <code>1</code>, means it's known.
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
|
public static final String PROP_STATE_CHANGE_DETAILS_KNOWN = "state_change_details_known"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Value <code>0</code> means it's not known. Value <code>1</code>, means it's known.
|
* Value <code>0</code> means it's not known. Value <code>1</code>, means it's known.
|
||||||
*/
|
*/
|
||||||
|
@ -68,12 +74,17 @@ public class ExecutionContextLabelText extends LabelText {
|
||||||
reasonLabel = MessagesForLaunchVM.State_change_reason__Watchpoint__label;
|
reasonLabel = MessagesForLaunchVM.State_change_reason__Watchpoint__label;
|
||||||
}
|
}
|
||||||
return reasonLabel;
|
return reasonLabel;
|
||||||
|
} else if ( ILaunchVMConstants.PROP_STATE_CHANGE_DETAILS.equals(propertyName) ) {
|
||||||
|
return properties.get(propertyName);
|
||||||
} else if ( ILaunchVMConstants.PROP_IS_SUSPENDED.equals(propertyName) ) {
|
} else if ( ILaunchVMConstants.PROP_IS_SUSPENDED.equals(propertyName) ) {
|
||||||
Boolean suspended = (Boolean)properties.get(propertyName);
|
Boolean suspended = (Boolean)properties.get(propertyName);
|
||||||
return suspended ? 1 : 0;
|
return suspended ? 1 : 0;
|
||||||
} else if ( PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ) {
|
} else if ( PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ) {
|
||||||
String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON);
|
String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON);
|
||||||
return (reason != null && !StateChangeReason.UNKNOWN.name().equals(reason)) ? 1 : 0;
|
return (reason != null && !StateChangeReason.UNKNOWN.name().equals(reason)) ? 1 : 0;
|
||||||
|
} else if ( PROP_STATE_CHANGE_DETAILS_KNOWN.equals(propertyName) ) {
|
||||||
|
String details = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_DETAILS);
|
||||||
|
return (details != null) ? 1 : 0;
|
||||||
} else if (PROP_NAME_KNOWN.equals(propertyName)) {
|
} else if (PROP_NAME_KNOWN.equals(propertyName)) {
|
||||||
return properties.get(IElementPropertiesProvider.PROP_NAME) != null ? 1 : 0;
|
return properties.get(IElementPropertiesProvider.PROP_NAME) != null ? 1 : 0;
|
||||||
} else if (IElementPropertiesProvider.PROP_NAME.equals(propertyName)) {
|
} else if (IElementPropertiesProvider.PROP_NAME.equals(propertyName)) {
|
||||||
|
@ -94,6 +105,8 @@ public class ExecutionContextLabelText extends LabelText {
|
||||||
IElementPropertiesProvider.PROP_NAME.equals(propertyName) ||
|
IElementPropertiesProvider.PROP_NAME.equals(propertyName) ||
|
||||||
PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ||
|
PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ||
|
||||||
ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) ||
|
ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) ||
|
||||||
|
PROP_STATE_CHANGE_DETAILS_KNOWN.equals(propertyName) ||
|
||||||
|
ILaunchVMConstants.PROP_STATE_CHANGE_DETAILS.equals(propertyName) ||
|
||||||
PROP_ID_KNOWN.equals(propertyName) ||
|
PROP_ID_KNOWN.equals(propertyName) ||
|
||||||
ILaunchVMConstants.PROP_ID.equals(propertyName))
|
ILaunchVMConstants.PROP_ID.equals(propertyName))
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,4 +36,9 @@ public interface ILaunchVMConstants {
|
||||||
|
|
||||||
public static final String PROP_STATE_CHANGE_REASON = "state_change_reason"; //$NON-NLS-1$
|
public static final String PROP_STATE_CHANGE_REASON = "state_change_reason"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
|
public static final String PROP_STATE_CHANGE_DETAILS = "state_change_details"; //$NON-NLS-1$
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,9 @@ AbstractContainerVMNode_No_columns__Error__label=<unavailable>
|
||||||
# {4} - 0=running/1=suspended
|
# {4} - 0=running/1=suspended
|
||||||
# {5} - state change reason available, 0=not available/1=available
|
# {5} - state change reason available, 0=not available/1=available
|
||||||
# {6} - state change reason
|
# {6} - 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,choice,0#|1# : {6}})
|
# {7} - state change details available, 0=not available/1=available
|
||||||
|
# {8} - state change details
|
||||||
|
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}}{7,choice,0#|1# - {8}})
|
||||||
|
|
||||||
AbstractThreadVMNode_No_columns__Error__label=<unavailable>
|
AbstractThreadVMNode_No_columns__Error__label=<unavailable>
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,18 @@ public interface IRunControl extends IDsfService
|
||||||
StateChangeReason getStateChangeReason();
|
StateChangeReason getStateChangeReason();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
|
public interface IExecutionDMData2 extends IExecutionDMData {
|
||||||
|
/**
|
||||||
|
* Optional method to return more detail about the suspended event, e.g.
|
||||||
|
* "Divide by zero exception"
|
||||||
|
* @return more detail about the suspended event, or null
|
||||||
|
*/
|
||||||
|
String getDetails();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves execution data for given context.
|
* Retrieves execution data for given context.
|
||||||
* @param dmc Context to retrieve data for.
|
* @param dmc Context to retrieve data for.
|
||||||
|
|
Loading…
Add table
Reference in a new issue