mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Correct presentation of the full names of variables that contain pointers.
This commit is contained in:
parent
5243e5bd71
commit
08ab887f65
2 changed files with 26 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
|||
2003-06-06 Mikhail Khodjaiants
|
||||
Correct presentation of the full names of variables that contain pointers.
|
||||
* CVariable.java
|
||||
|
||||
2003-06-06 Mikhail Khodjaiants
|
||||
Changed the implementation of the'getName' method of CVariable to return
|
||||
the actual names of array members.
|
||||
|
|
|
@ -358,6 +358,7 @@ public abstract class CVariable extends CDebugElement
|
|||
if ( fName == null )
|
||||
{
|
||||
String cdiName = ( getOriginalCDIVariable() != null ) ? getOriginalCDIVariable().getName() : null;
|
||||
fName = cdiName;
|
||||
if ( cdiName != null && getParent() instanceof ICValue )
|
||||
{
|
||||
CVariable parent = getParentVariable();
|
||||
|
@ -370,10 +371,6 @@ public abstract class CVariable extends CDebugElement
|
|||
fName = parent.getName() + '[' + cdiName + ']';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fName = cdiName;
|
||||
}
|
||||
}
|
||||
return fName;
|
||||
}
|
||||
|
@ -796,7 +793,26 @@ public abstract class CVariable extends CDebugElement
|
|||
{
|
||||
sb.insert( 0, '(' );
|
||||
if ( i > 0 )
|
||||
sb.append( ( vars[i - 1].isPointer() ) ? "->" : "." );
|
||||
{
|
||||
if ( vars[i - 1].isPointer() )
|
||||
{
|
||||
if ( vars[i].getName().charAt( 0 ) == '*' && vars[i-1].getName().equals( vars[i].getName().substring( 1 ) ) )
|
||||
{
|
||||
sb.insert( 0, '*' );
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( "->" );
|
||||
sb.append( vars[i].getName() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( '.' );
|
||||
sb.append( vars[i].getName() );
|
||||
}
|
||||
}
|
||||
else
|
||||
sb.append( vars[i].getName() );
|
||||
sb.append( ')' );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue