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 2004-09-13 Mikhail Khodjaiants
Fix for bug 72555: "Toggle breakpoint" action doesn't remove function breakpoints from editor. Fix for bug 72555: "Toggle breakpoint" action doesn't remove function breakpoints from editor.
* CDIDebugModel.java * CDIDebugModel.java

View file

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

View file

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

View file

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

View file

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