1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 00:35:49 +02:00

2004-10-26 Alain Magloire

Remove of ICDISourceManager in CDI
	* cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java
	* cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java
	* cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java
	* cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISourceManagement.java

	* Disassembly.java
This commit is contained in:
Alain Magloire 2004-10-26 19:43:50 +00:00
parent 3374f172f0
commit 10e1d937dd
5 changed files with 44 additions and 47 deletions

View file

@ -1,3 +1,12 @@
2004-10-26 Alain Magloire
Remove of ICDISourceManager in CDI
* cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java
* cdi/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java
* cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java
* cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISourceManagement.java
* Disassembly.java
2004-10-26 Alain Magloire 2004-10-26 Alain Magloire
Remove of ICDISignalManager in CDI Remove of ICDISignalManager in CDI
* cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java * cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java

View file

@ -67,13 +67,6 @@ public interface ICDISession {
*/ */
ICDIMemoryManager getMemoryManager(); ICDIMemoryManager getMemoryManager();
/**
* Returns the source manager of this debug session.
*
* @return the source manager
*/
ICDISourceManager getSourceManager();
/** /**
* Returns the event manager of this debug session. * Returns the event manager of this debug session.
* *

View file

@ -9,22 +9,19 @@
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.core.cdi; package org.eclipse.cdt.debug.core.cdi.model;
import java.math.BigInteger; import java.math.BigInteger;
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
/** /**
* *
* Maintains the list of directories to search for source files. * Maintains the list of directories to search for source files.
* Auto update is off by default. * Auto update is off by default.
* *
* @since Jul 9, 2002
*/ */
public interface ICDISourceManager extends ICDIManager { public interface ICDISourceManagement {
/** /**
* Set the source search paths for the debug session. * Set the source search paths for the debug session.
* @param String array of search paths * @param String array of search paths
@ -93,4 +90,5 @@ public interface ICDISourceManager extends ICDIManager {
int lines) int lines)
throws CDIException; throws CDIException;
} }

View file

@ -25,7 +25,8 @@ import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
* *
* @since Jul 8, 2002 * @since Jul 8, 2002
*/ */
public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement, ICDISessionObject { public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement,
ICDISourceManagement, ICDISessionObject {
/** /**
* Gets the target process. * Gets the target process.

View file

@ -16,10 +16,9 @@ import org.eclipse.cdt.core.IAddress;
import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDebugConstants; import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.ICDISourceManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.model.ICStackFrame; import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.IDisassembly; import org.eclipse.cdt.debug.core.model.IDisassembly;
import org.eclipse.cdt.debug.core.model.IDisassemblyBlock; import org.eclipse.cdt.debug.core.model.IDisassemblyBlock;
@ -56,40 +55,37 @@ public class Disassembly extends CDebugElement implements IDisassembly {
} }
private DisassemblyBlock createBlock( ICStackFrame frame ) throws DebugException { private DisassemblyBlock createBlock( ICStackFrame frame ) throws DebugException {
ICDISession session = (ICDISession)getDebugTarget().getAdapter( ICDISession.class ); ICDITarget target = (ICDITarget)getDebugTarget().getAdapter( ICDITarget.class );
if ( session != null ) { if ( target != null ) {
ICDISourceManager sm = session.getSourceManager(); String fileName = frame.getFile();
if ( sm != null ) { int lineNumber = frame.getLineNumber();
String fileName = frame.getFile(); ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
int lineNumber = frame.getLineNumber(); IAddress address = frame.getAddress();
ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0]; if ( fileName != null && fileName.length() > 0 ) {
IAddress address = frame.getAddress(); try {
if ( fileName != null && fileName.length() > 0 ) { mixedInstrs = target.getMixedInstructions( fileName,
try { lineNumber,
mixedInstrs = sm.getMixedInstructions( fileName, CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) );
lineNumber,
CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );
}
} }
// Double check if debugger returns correct address range. catch( CDIException e ) {
if ( mixedInstrs.length == 0 || targetRequestFailed( e.getMessage(), e );
!containsAddress( mixedInstrs, address ) ) {
try {
BigInteger addr = new BigInteger( address.toString() );
ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( addr, addr.add( BigInteger.valueOf( DISASSEMBLY_BLOCK_SIZE ) ) ) );
return DisassemblyBlock.create( this, instructions );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );
}
}
else {
return DisassemblyBlock.create( this, mixedInstrs );
} }
} }
// Double check if debugger returns correct address range.
if ( mixedInstrs.length == 0 ||
!containsAddress( mixedInstrs, address ) ) {
try {
BigInteger addr = new BigInteger( address.toString() );
ICDIInstruction[] instructions = getFunctionInstructions( target.getInstructions( addr, addr.add( BigInteger.valueOf( DISASSEMBLY_BLOCK_SIZE ) ) ) );
return DisassemblyBlock.create( this, instructions );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );
}
}
else {
return DisassemblyBlock.create( this, mixedInstrs );
}
} }
return null; return null;
} }