1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 00:35:49 +02:00

Do not use "void" if parameter's list is empty when constructing a function or method name for function breakpoints. Name mapping should be done on the implementation level.

This commit is contained in:
Mikhail Khodjaiants 2004-11-26 19:23:45 +00:00
parent 0ed3dbe9b1
commit 90097c4feb
2 changed files with 19 additions and 26 deletions

View file

@ -1,3 +1,8 @@
2004-11-26 Mikhail Khodjaiants
Do not use "void" if parameter's list is empty when constructing a function or
method name for function breakpoints. Name mapping should be done on the implementation level.
* ToggleBreakpointAdapter.java
2004-11-25 Mikhail Khodjaiants
Fix for bug 79452: Unable to set a breakpoint on a class method.
* plugin.xml

View file

@ -15,6 +15,7 @@ import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IDeclaration;
import org.eclipse.cdt.core.model.IFunction;
import org.eclipse.cdt.core.model.IFunctionDeclaration;
import org.eclipse.cdt.core.model.IMethod;
import org.eclipse.cdt.core.model.ISourceRange;
import org.eclipse.cdt.core.model.ITranslationUnit;
@ -384,19 +385,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
StringBuffer name = new StringBuffer( functionName );
ITranslationUnit tu = function.getTranslationUnit();
if ( tu != null && tu.isCXXLanguage() ) {
String[] params = function.getParameterTypes();
name.append( '(' );
if ( params.length == 0 ) {
name.append( "void" ); //$NON-NLS-1$
}
else {
for( int i = 0; i < params.length; ++i ) {
name.append( params[i] );
if ( i != params.length - 1 )
name.append( ',' );
}
}
name.append( ')' );
appendParameters( name, function );
}
return name.toString();
}
@ -410,22 +399,21 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
parent = parent.getParent();
}
name.append( methodName );
String[] params = method.getParameterTypes();
name.append( '(' );
if ( params.length == 0 ) {
name.append( "void" ); //$NON-NLS-1$
}
else {
for( int i = 0; i < params.length; ++i ) {
name.append( params[i] );
if ( i != params.length - 1 )
name.append( ',' );
}
}
name.append( ')' );
appendParameters( name, method );
return name.toString();
}
private void appendParameters( StringBuffer sb, IFunctionDeclaration fd ) {
String[] params = fd.getParameterTypes();
sb.append( '(' );
for( int i = 0; i < params.length; ++i ) {
sb.append( params[i] );
if ( i != params.length - 1 )
sb.append( ',' );
}
sb.append( ')' );
}
private String getVariableName( IVariable variable ) {
return variable.getElementName();
}