1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Moved to the new CDI interfaces.

This commit is contained in:
Mikhail Khodjaiants 2004-09-13 21:37:11 +00:00
parent 3fa82e8395
commit c23c011ae2
5 changed files with 35 additions and 36 deletions

View file

@ -1,3 +1,10 @@
2004-09-13 Mikhail Khodjaiants
Moved to the new CDI interfaces.
* CDebugTarget.java
* CSignal.java
* CStackFrame.java
* CThread.java
2004-09-13 Mikhail Khodjaiants
Fix for bug 72555: "Toggle breakpoint" action doesn't remove function breakpoints from editor.
* CDIDebugModel.java

View file

@ -487,7 +487,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
public void run() {
try {
getCDITarget().resume();
getCDITarget().resume( false );
}
catch( CDIException e ) {
setState( oldState );
@ -1350,7 +1350,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
}
ICDILocation location = getCDITarget().createLocation( fileName, null, lineNumber );
try {
getCDITarget().runUntil( location );
getCDITarget().stepUntil( location );
}
catch( CDIException e ) {
if ( skipBreakpoints ) {
@ -1537,7 +1537,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
}
ICDILocation location = getCDITarget().createLocation( address );
try {
getCDITarget().runUntil( location );
getCDITarget().stepUntil( location );
}
catch( CDIException e ) {
if ( skipBreakpoints ) {
@ -1567,7 +1567,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
public void run() {
try {
getCDITarget().signal();
getCDITarget().resume( false );
}
catch( CDIException e ) {
setState( oldState );
@ -1615,7 +1615,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return;
ICDILocation location = getCDITarget().createLocation( fileName, null, lineNumber );
try {
getCDITarget().jump( location );
getCDITarget().resume( location );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );
@ -1638,7 +1638,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return;
ICDILocation location = getCDITarget().createLocation( address );
try {
getCDITarget().jump( location );
getCDITarget().resume( location );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );

View file

@ -107,7 +107,7 @@ public class CSignal extends CDebugElement implements ICSignal, ICDIEventListene
{
try
{
getCDITarget().signal( getCDISignal() );
getCDITarget().resume( getCDISignal() );
}
catch( CDIException e )
{

View file

@ -234,7 +234,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
*/
public boolean canStepInto() {
try {
return exists() && isTopStackFrame() && getThread().canStepInto();
return exists() /*&& isTopStackFrame()*/ && getThread().canStepInto();
}
catch( DebugException e ) {
logError( e );
@ -295,34 +295,22 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
* @see org.eclipse.debug.core.model.IStep#stepOver()
*/
public void stepOver() throws DebugException {
if ( !canStepOver() ) {
return;
}
if ( isTopStackFrame() ) {
if ( canStepOver() ) {
getThread().stepOver();
}
else {
// ((CThread)getThread()).stepToFrame( this );
getThread().stepOver(); // for now
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepReturn()
*/
public void stepReturn() throws DebugException {
if ( !canStepReturn() ) {
return;
}
if ( isTopStackFrame() ) {
getThread().stepReturn();
}
else {
/*
* List frames = ((CThread)getThread()).computeStackFrames(); int index = frames.indexOf( this ); if ( index >= 0 && index < frames.size() - 1 ) {
* IStackFrame nextFrame = (IStackFrame)frames.get( index + 1 ); ((CThread)getThread()).stepToFrame( nextFrame ); }
*/
getThread().stepReturn(); // for now
if ( canStepReturn() ) {
try {
getCDIStackFrame().stepReturn();
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), null );
}
}
}

View file

@ -425,7 +425,7 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void run() {
try {
getCDIThread().resume();
getCDIThread().resume( false );
}
catch( CDIException e ) {
setState( oldState );
@ -521,10 +521,10 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void run() {
try {
if ( !isInstructionsteppingEnabled() ) {
getCDIThread().stepInto();
getCDIThread().stepInto( 1 );
}
else {
getCDIThread().stepIntoInstruction();
getCDIThread().stepIntoInstruction( 1 );
}
}
catch( CDIException e ) {
@ -548,10 +548,10 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void run() {
try {
if ( !isInstructionsteppingEnabled() ) {
getCDIThread().stepOver();
getCDIThread().stepOver( 1 );
}
else {
getCDIThread().stepOverInstruction();
getCDIThread().stepOverInstruction( 1 );
}
}
catch( CDIException e ) {
@ -568,15 +568,19 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void stepReturn() throws DebugException {
if ( !canStepReturn() )
return;
IStackFrame[] frames = getStackFrames();
if ( frames.length == 0 )
return;
final IStackFrame f = frames[0];
final CDebugElementState oldState = getState();
setState( CDebugElementState.STEPPING );
DebugPlugin.getDefault().asyncExec( new Runnable() {
public void run() {
try {
getCDIThread().stepReturn();
f.stepReturn();
}
catch( CDIException e ) {
catch( DebugException e ) {
setState( oldState );
failed( CoreModelMessages.getString( "CThread.6" ), e ); //$NON-NLS-1$
}
@ -923,7 +927,7 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
return ((CDebugTarget)getDebugTarget()).isInstructionSteppingEnabled();
}
protected void failed( String message, CDIException e ) {
protected void failed( String message, Throwable e ) {
MultiStatus ms = new MultiStatus( CDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, message, null );
ms.add( new Status( IStatus.ERROR, CDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), e ) );
CDebugUtils.error( ms, this );