1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 330875 - Use of Parenthesis in Stack Frame Name

This commit is contained in:
Ken Ryall 2011-01-13 12:29:11 +00:00
parent 825a17640d
commit ef899d10d1
4 changed files with 73 additions and 9 deletions

View file

@ -100,7 +100,10 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
if (line != null && line >= 0 && file != null && file.length() > 0)
{
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__text_format;
if (function != null && function.contains(")")) //$NON-NLS-1$
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__text_format;
else
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
propertyNames = new String[] {
ILaunchVMConstants.PROP_FRAME_ADDRESS,
ILaunchVMConstants.PROP_FRAME_FUNCTION,
@ -111,7 +114,10 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
}
else if (function != null && function.length() > 0 && module != null && module.length() > 0)
{
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format;
if (function.contains(")")) //$NON-NLS-1$
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format;
else
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format;
propertyNames = new String[] {
ILaunchVMConstants.PROP_FRAME_ADDRESS,
ILaunchVMConstants.PROP_FRAME_FUNCTION,
@ -126,7 +132,10 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
}
else if (function != null && function.length() > 0)
{
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__text_format;
if (function.contains(")")) //$NON-NLS-1$
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__text_format;
else
formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__add_parens__text_format;
propertyNames = new String[] {
ILaunchVMConstants.PROP_FRAME_ADDRESS,
ILaunchVMConstants.PROP_FRAME_FUNCTION};

View file

@ -19,9 +19,12 @@ import org.eclipse.osgi.util.NLS;
public class MessagesForLaunchVM extends NLS {
public static String StackFramesVMNode_No_columns__Incomplete_stack_marker__text_format;
public static String StackFramesVMNode_No_columns__text_format;
public static String StackFramesVMNode_No_columns__add_parens__text_format;
public static String StackFramesVMNode_No_columns__No_line__text_format;
public static String StackFramesVMNode_No_columns__No_line__add_parens__text_format;
public static String StackFramesVMNode_No_columns__No_function__text_format;
public static String StackFramesVMNode_No_columns__No_module__text_format;
public static String StackFramesVMNode_No_columns__No_module__add_parens__text_format;
public static String StackFramesVMNode_No_columns__Address_only__text_format;
public static String AbstractContainerVMNode_No_columns__text_format;

View file

@ -17,12 +17,14 @@ StackFramesVMNode_No_columns__Incomplete_stack_marker__text_format=<...more fram
# {3} - line
# {4} - column
# {5} - module
StackFramesVMNode_No_columns__text_format={1}() at {2}:{3} {0}{4,choice,0#|1# :{4}}
StackFramesVMNode_No_columns__text_format={1} at {2}:{3} {0}{4,choice,0#|1# :{4}}
StackFramesVMNode_No_columns__add_parens__text_format={1}() at {2}:{3} {0}{4,choice,0#|1# :{4}}
# {0} - address
# {1} - function
# {2} - module
StackFramesVMNode_No_columns__No_line__text_format={1}() [{2}] at {0}
StackFramesVMNode_No_columns__No_line__text_format={1} [{2}] at {0}
StackFramesVMNode_No_columns__No_line__add_parens__text_format={1}() [{2}] at {0}
# {0} - address
# {1} - module
@ -30,7 +32,8 @@ StackFramesVMNode_No_columns__No_function__text_format=[{1}] at {0}
# {0} - address
# {1} - function
StackFramesVMNode_No_columns__No_module__text_format={1}() at {0}
StackFramesVMNode_No_columns__No_module__text_format={1} at {0}
StackFramesVMNode_No_columns__No_module__add_parens__text_format={1}() at {0}
# {0} - address
StackFramesVMNode_No_columns__Address_only__text_format={0}

View file

@ -172,9 +172,30 @@ public class StackFramesVMNode extends AbstractDMVMNode
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
Integer line = (Integer)properties.get(ILaunchVMConstants.PROP_FRAME_LINE);
String file = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FILE);
return line != null && line >= 0 && file != null && file.length() > 0;
String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
return line != null && line >= 0 && file != null && file.length() > 0 &&
function != null && function.contains(")"); //$NON-NLS-1$
};
},
new LabelText(
MessagesForLaunchVM.StackFramesVMNode_No_columns__add_parens__text_format,
new String[] {
ILaunchVMConstants.PROP_FRAME_ADDRESS,
ILaunchVMConstants.PROP_FRAME_FUNCTION,
ILaunchVMConstants.PROP_FRAME_FILE,
ILaunchVMConstants.PROP_FRAME_LINE,
ILaunchVMConstants.PROP_FRAME_COLUMN,
ILaunchVMConstants.PROP_FRAME_MODULE})
{
@Override
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
Integer line = (Integer)properties.get(ILaunchVMConstants.PROP_FRAME_LINE);
String file = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FILE);
String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
return line != null && line >= 0 && file != null && file.length() > 0 &&
(function == null || !function.contains(")")); //$NON-NLS-1$
};
},
new LabelText(
MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format,
new String[] {
@ -186,9 +207,25 @@ public class StackFramesVMNode extends AbstractDMVMNode
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
return function != null && function.length() > 0 && module != null && module.length() > 0;
return function != null && function.length() > 0 && function.contains(")") && //$NON-NLS-1$
module != null && module.length() > 0;
};
},
new LabelText(
MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__add_parens__text_format,
new String[] {
ILaunchVMConstants.PROP_FRAME_ADDRESS,
ILaunchVMConstants.PROP_FRAME_FUNCTION,
ILaunchVMConstants.PROP_FRAME_MODULE})
{
@Override
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE);
return function != null && function.length() > 0 && !function.contains(")") && //$NON-NLS-1$
module != null && module.length() > 0;
};
},
new LabelText(
MessagesForLaunchVM.StackFramesVMNode_No_columns__No_function__text_format,
new String[] {
@ -210,7 +247,19 @@ public class StackFramesVMNode extends AbstractDMVMNode
@Override
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
return function != null && function.length() > 0;
return function != null && function.length() > 0 && function.contains(")"); //$NON-NLS-1$
};
},
new LabelText(
MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__add_parens__text_format,
new String[] {
ILaunchVMConstants.PROP_FRAME_ADDRESS,
ILaunchVMConstants.PROP_FRAME_FUNCTION})
{
@Override
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION);
return function != null && function.length() > 0 && !function.contains(")"); //$NON-NLS-1$
};
},
new LabelText(