Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2003-11-13 21:07:20 +0000
committerMikhail Khodjaiants2003-11-13 21:07:20 +0000
commit74005e4343f6494dec3e6599f280f1d63519f77a (patch)
tree0cdd0f0bbe375664cd8a80f22788e0174b9404b2
parent335bab74c2b37bf59a0f15a42f8dbf0975433de3 (diff)
downloadorg.eclipse.cdt-74005e4343f6494dec3e6599f280f1d63519f77a.tar.gz
org.eclipse.cdt-74005e4343f6494dec3e6599f280f1d63519f77a.tar.xz
org.eclipse.cdt-74005e4343f6494dec3e6599f280f1d63519f77a.zip
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.
-rw-r--r--debug/org.eclipse.cdt.debug.ui/ChangeLog5
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java47
2 files changed, 34 insertions, 18 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog
index 4a7e74aae2..990641cb0c 100644
--- a/debug/org.eclipse.cdt.debug.ui/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog
@@ -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'.
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java
index bcf8e5aaf7..6a7e46c2fe 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java
@@ -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

Back to the top