1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 07:25:23 +02:00

More implementation.

This commit is contained in:
Mikhail Khodjaiants 2002-08-16 23:13:03 +00:00
parent 27e3c54b89
commit 60da64d862

View file

@ -9,7 +9,10 @@ package org.eclipse.cdt.debug.internal.ui;
import java.text.MessageFormat;
import java.util.HashMap;
import org.eclipse.cdt.debug.core.IStackFrameInfo;
import org.eclipse.cdt.debug.core.IState;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IDisconnect;
@ -114,7 +117,7 @@ public class CDTDebugModelPresentation extends LabelProvider
{
if ( element instanceof IStackFrame )
{
label.append( getStackFrameText( (IStackFrame)element ) );
label.append( getStackFrameText( (IStackFrame)element, showQualified ) );
return label.toString();
}
@ -197,8 +200,25 @@ public class CDTDebugModelPresentation extends LabelProvider
return getFormattedString( "Thread [{0}] (Suspended)", thread.getName() );
}
protected String getStackFrameText( IStackFrame stackFrame ) throws DebugException
protected String getStackFrameText( IStackFrame stackFrame, boolean qualified ) throws DebugException
{
IStackFrameInfo info = (IStackFrameInfo)stackFrame.getAdapter( IStackFrameInfo.class );
if ( info != null )
{
String label = new String();
label += info.getLevel() + " ";
if ( info.getFunction() != null )
label += info.getFunction() + "() ";
if ( info.getFile() != null )
{
IPath path = new Path( info.getFile() );
label += "at " + ( qualified ? path.toOSString() : path.lastSegment() ) + ":";
}
if ( info.getFrameLineNumber() != 0 )
label += info.getFrameLineNumber();
return label;
}
return stackFrame.getName();
}