mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
Reformat the file, tabs and spaces were mixed
Change-Id: If136dc3222c23f2ed41539d25b509161a0313475 Signed-off-by: Yannick Mayeur <yannick.mayeur@gmail.com>
This commit is contained in:
parent
d4ecd37bb1
commit
5defeb26ac
1 changed files with 79 additions and 97 deletions
|
@ -33,8 +33,8 @@ import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
import com.ibm.icu.text.MessageFormat;
|
import com.ibm.icu.text.MessageFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This factory provides an instance of ICSourceNotFoundDescription that
|
* This factory provides an instance of ICSourceNotFoundDescription that can
|
||||||
* can generate a description of a IFrameDMContext.
|
* generate a description of a IFrameDMContext.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
|
@ -42,9 +42,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
|
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
|
||||||
if (adapterType.equals(ICSourceNotFoundDescription.class) &&
|
if (adapterType.equals(ICSourceNotFoundDescription.class) && adaptableObject instanceof IFrameDMContext) {
|
||||||
adaptableObject instanceof IFrameDMContext)
|
|
||||||
{
|
|
||||||
final IFrameDMContext frameDMC = (IFrameDMContext) adaptableObject;
|
final IFrameDMContext frameDMC = (IFrameDMContext) adaptableObject;
|
||||||
return (T) new ICSourceNotFoundDescription() {
|
return (T) new ICSourceNotFoundDescription() {
|
||||||
|
|
||||||
|
@ -53,8 +51,8 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
Query<IStack.IFrameDMData> query = new Query<IStack.IFrameDMData>() {
|
Query<IStack.IFrameDMData> query = new Query<IStack.IFrameDMData>() {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(DataRequestMonitor<IStack.IFrameDMData> rm) {
|
protected void execute(DataRequestMonitor<IStack.IFrameDMData> rm) {
|
||||||
DsfServicesTracker tracker =
|
DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
|
||||||
new DsfServicesTracker(DsfUIPlugin.getBundleContext(), frameDMC.getSessionId());
|
frameDMC.getSessionId());
|
||||||
|
|
||||||
IStack stack = tracker.getService(IStack.class);
|
IStack stack = tracker.getService(IStack.class);
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
|
@ -67,8 +65,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
DsfSession session = DsfSession.getSession(frameDMC.getSessionId());
|
DsfSession session = DsfSession.getSession(frameDMC.getSessionId());
|
||||||
if (session != null && session.getExecutor() != null)
|
if (session != null && session.getExecutor() != null) {
|
||||||
{
|
|
||||||
session.getExecutor().execute(query);
|
session.getExecutor().execute(query);
|
||||||
try {
|
try {
|
||||||
IFrameDMData dmData = query.get();
|
IFrameDMData dmData = query.get();
|
||||||
|
@ -78,7 +75,8 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return frameDMC.toString();
|
return frameDMC.toString();
|
||||||
}};
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -88,13 +86,14 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
return new Class[] { ICSourceNotFoundDescription.class };
|
return new Class[] { ICSourceNotFoundDescription.class };
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates a brief description of stack frame data.
|
/**
|
||||||
* Based on code in StackFrameVMNode.
|
* Creates a brief description of stack frame data. Based on code in
|
||||||
|
* StackFrameVMNode.
|
||||||
|
*
|
||||||
* @param frame
|
* @param frame
|
||||||
* @return the frame description
|
* @return the frame description
|
||||||
*/
|
*/
|
||||||
private static String getFrameDescription(IStack.IFrameDMData frame)
|
private static String getFrameDescription(IStack.IFrameDMData frame) {
|
||||||
{
|
|
||||||
String formatString = ""; //$NON-NLS-1$
|
String formatString = ""; //$NON-NLS-1$
|
||||||
String[] propertyNames = null;
|
String[] propertyNames = null;
|
||||||
HashMap<String, Object> properties = new HashMap<String, Object>();
|
HashMap<String, Object> properties = new HashMap<String, Object>();
|
||||||
|
@ -104,53 +103,36 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
|
||||||
String file = (String) properties.get(ILaunchVMConstants.PROP_FRAME_FILE);
|
String file = (String) properties.get(ILaunchVMConstants.PROP_FRAME_FILE);
|
||||||
String function = (String) properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
|
String function = (String) properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
|
||||||
String module = (String) properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
|
String module = (String) properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
|
||||||
if (line != null && line >= 0 && file != null && !file.isEmpty())
|
if (line != null && line >= 0 && file != null && !file.isEmpty()) {
|
||||||
{
|
|
||||||
if (function != null && function.contains(")")) //$NON-NLS-1$
|
if (function != null && function.contains(")")) //$NON-NLS-1$
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__text_format;
|
||||||
else
|
else
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
|
||||||
propertyNames = new String[] {
|
propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
||||||
ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
ILaunchVMConstants.PROP_FRAME_FUNCTION, ILaunchVMConstants.PROP_FRAME_FILE,
|
||||||
ILaunchVMConstants.PROP_FRAME_FUNCTION,
|
ILaunchVMConstants.PROP_FRAME_LINE, ILaunchVMConstants.PROP_FRAME_COLUMN,
|
||||||
ILaunchVMConstants.PROP_FRAME_FILE,
|
|
||||||
ILaunchVMConstants.PROP_FRAME_LINE,
|
|
||||||
ILaunchVMConstants.PROP_FRAME_COLUMN,
|
|
||||||
ILaunchVMConstants.PROP_FRAME_MODULE };
|
ILaunchVMConstants.PROP_FRAME_MODULE };
|
||||||
}
|
} else if (function != null && !function.isEmpty() && module != null && !module.isEmpty()) {
|
||||||
else if (function != null && !function.isEmpty() && module != null && !module.isEmpty())
|
|
||||||
{
|
|
||||||
if (function.contains(")")) //$NON-NLS-1$
|
if (function.contains(")")) //$NON-NLS-1$
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format;
|
||||||
else
|
else
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
|
||||||
propertyNames = new String[] {
|
propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
||||||
ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
ILaunchVMConstants.PROP_FRAME_FUNCTION, ILaunchVMConstants.PROP_FRAME_MODULE };
|
||||||
ILaunchVMConstants.PROP_FRAME_FUNCTION,
|
} else if (module != null && !module.isEmpty()) {
|
||||||
ILaunchVMConstants.PROP_FRAME_MODULE};
|
|
||||||
}
|
|
||||||
else if (module != null && !module.isEmpty())
|
|
||||||
{
|
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_function__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_function__text_format;
|
||||||
propertyNames = new String[] {
|
propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
||||||
ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
|
||||||
ILaunchVMConstants.PROP_FRAME_MODULE };
|
ILaunchVMConstants.PROP_FRAME_MODULE };
|
||||||
}
|
} else if (function != null && !function.isEmpty()) {
|
||||||
else if (function != null && !function.isEmpty())
|
|
||||||
{
|
|
||||||
if (function.contains(")")) //$NON-NLS-1$
|
if (function.contains(")")) //$NON-NLS-1$
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__text_format;
|
||||||
else
|
else
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__add_parens__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__add_parens__text_format;
|
||||||
propertyNames = new String[] {
|
propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
||||||
ILaunchVMConstants.PROP_FRAME_ADDRESS,
|
|
||||||
ILaunchVMConstants.PROP_FRAME_FUNCTION };
|
ILaunchVMConstants.PROP_FRAME_FUNCTION };
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__Address_only__text_format;
|
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__Address_only__text_format;
|
||||||
propertyNames = new String[] {
|
propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS };
|
||||||
ILaunchVMConstants.PROP_FRAME_ADDRESS};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] propertyValues = new Object[propertyNames.length];
|
Object[] propertyValues = new Object[propertyNames.length];
|
||||||
|
|
Loading…
Add table
Reference in a new issue