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

Use 'StringBuffer' instead of 'String' when generating stack frame labels.

Added a label for dummy stack frames instead of using the name provided by the rendered object.
This commit is contained in:
Mikhail Khodjaiants 2003-11-13 21:07:20 +00:00
parent 335bab74c2
commit 74005e4343
2 changed files with 34 additions and 18 deletions

View file

@ -1,3 +1,8 @@
2003-11-13 Mikhail Khodjaiants
Use 'StringBuffer' instead of 'String' when generating stack frame labels.
Added a label for dummy stack frames instead of using the name provided by the rendered object.
* CDTDebugModelPresentation.java
2003-11-05 Mikhail Khodjaiants
The argument type of the 'getBreakpointAddress' of 'ICBreakpointManager' is changed from
'ICBreakpoint' to 'ICBreakpointManager'.

View file

@ -96,6 +96,8 @@ public class CDTDebugModelPresentation extends LabelProvider
* @see #setAttribute(String, Object)
*/
public final static String DISPLAY_FULL_PATHS = "DISPLAY_FULL_PATHS"; //$NON-NLS-1$
private static final String DUMMY_STACKFRAME_LABEL = "...";
protected HashMap fAttributes = new HashMap(3);
@ -521,32 +523,41 @@ public class CDTDebugModelPresentation extends LabelProvider
IStackFrameInfo info = (IStackFrameInfo)stackFrame.getAdapter( IStackFrameInfo.class );
if ( info != null )
{
String label = new String();
label += info.getLevel() + " ";
if ( info.getFunction() != null && info.getFunction().trim().length() > 0 )
StringBuffer label = new StringBuffer();
label.append( info.getLevel() );
label.append( ' ' );
if ( info.getFunction() != null )
{
label += info.getFunction() + "() ";
if ( info.getFile() != null )
String function = info.getFunction().trim();
if ( function.length() > 0 )
{
IPath path = new Path( info.getFile() );
if ( !path.isEmpty() )
label.append( function );
label.append( "() " );
if ( info.getFile() != null )
{
label += "at " + ( qualified ? path.toOSString() : path.lastSegment() ) + ":";
if ( info.getFrameLineNumber() != 0 )
label += info.getFrameLineNumber();
IPath path = new Path( info.getFile() );
if ( !path.isEmpty() )
{
label.append( "at " );
label.append( ( qualified ? path.toOSString() : path.lastSegment() ) );
label.append( ":" );
if ( info.getFrameLineNumber() != 0 )
label.append( info.getFrameLineNumber() );
}
}
}
}
else
label += "<symbol is not available>";
return label;
label.append( "<symbol is not available>" );
return label.toString();
}
IDummyStackFrame dummy = (IDummyStackFrame)stackFrame.getAdapter( IDummyStackFrame.class );
if ( dummy != null )
{
return stackFrame.getName();
}
return stackFrame.getName();
return ( stackFrame.getAdapter( IDummyStackFrame.class ) != null ) ?
getDummyStackFrameLabel( stackFrame ) : stackFrame.getName();
}
private String getDummyStackFrameLabel( IStackFrame stackFrame )
{
return DUMMY_STACKFRAME_LABEL;
}
protected String getVariableText( IVariable var ) throws DebugException