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

The presentation of the stack frame in the Debug view.

This commit is contained in:
Mikhail Khodjaiants 2002-08-16 23:12:38 +00:00
parent 20a4419800
commit 27e3c54b89
3 changed files with 102 additions and 6 deletions

View file

@ -0,0 +1,54 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.core;
/**
*
* Provides the access to the stack frame information.
*
* @since Aug 16, 2002
*/
public interface IStackFrameInfo
{
/**
* Returns the address of this stack frame.
*
* @return the address of this stack frame
*/
long getAddress();
/**
* Returns the source file of this stack frame or <code>null</code>
* if the source file is unknown.
*
* @return the source file of this stack frame
*/
String getFile();
/**
* Returns the function of this stack frame or <code>null</code>
* if the function is unknown.
*
* @return the function of this stack frame
*/
String getFunction();
/**
* Returns the line number of this stack frame or <code>0</code>
* if the line number is unknown.
*
* @return the line number of this stack frame
*/
int getFrameLineNumber();
/**
* Returns the level of this stack frame.
*
* @return the level of this stack frame
*/
int getLevel();
}

View file

@ -47,6 +47,8 @@ public interface ICDIStackFrame extends ICDIObject
/**
* Returns the level of the stack frame.
*
* @return the level of the stack frame
*/
int getLevel();
}

View file

@ -3,21 +3,20 @@
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.internal.core;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.debug.core.IStackFrameInfo;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.debug.core.DebugException;
@ -33,7 +32,8 @@ import org.eclipse.debug.core.model.IVariable;
* @since Aug 7, 2002
*/
public class CStackFrame extends CDebugElement
implements IStackFrame,
implements IStackFrame,
IStackFrameInfo,
ICDIEventListener
{
/**
@ -484,8 +484,6 @@ public class CStackFrame extends CDebugElement
*/
protected static boolean equalFrame( ICDIStackFrame frameOne, ICDIStackFrame frameTwo )
{
//return ( frameOne.getParent().equals( frameTwo.getParent() ) &&
// frameOne.getLocation().equals( frameTwo.getLocation() ) );
return ( frameOne != null && frameTwo != null && frameOne.getLocation().equals( frameTwo.getLocation() ) );
}
@ -507,6 +505,10 @@ public class CStackFrame extends CDebugElement
{
return getCDIStackFrame();
}
if ( adapter == IStackFrameInfo.class )
{
return this;
}
return super.getAdapter( adapter );
}
@ -576,4 +578,42 @@ public class CStackFrame extends CDebugElement
((CVariable)it.next()).dispose();
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.IStackFrameInfo#getAddress()
*/
public long getAddress()
{
return getCDIStackFrame().getLocation().getAddress();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.IStackFrameInfo#getFile()
*/
public String getFile()
{
return getCDIStackFrame().getLocation().getFile();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.IStackFrameInfo#getFunction()
*/
public String getFunction()
{
return getCDIStackFrame().getLocation().getFunction();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.IStackFrameInfo#getLevel()
*/
public int getLevel()
{
return getCDIStackFrame().getLevel();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.IStackFrameInfo#getFrameLineNumber()
*/
public int getFrameLineNumber()
{
return getCDIStackFrame().getLocation().getLineNumber();
}
}