1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +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
Remove of ICDISignalManager in CDI
* cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java

View file

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

View file

@ -9,22 +9,19 @@
* 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 org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
import org.eclipse.cdt.debug.core.cdi.CDIException;
/**
*
* Maintains the list of directories to search for source files.
* 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.
* @param String array of search paths
@ -93,4 +90,5 @@ public interface ICDISourceManager extends ICDIManager {
int lines)
throws CDIException;
}

View file

@ -25,7 +25,8 @@ import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
*
* @since Jul 8, 2002
*/
public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement, ICDISessionObject {
public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement,
ICDISourceManagement, ICDISessionObject {
/**
* 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.ICDebugConstants;
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.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.IDisassembly;
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 {
ICDISession session = (ICDISession)getDebugTarget().getAdapter( ICDISession.class );
if ( session != null ) {
ICDISourceManager sm = session.getSourceManager();
if ( sm != null ) {
String fileName = frame.getFile();
int lineNumber = frame.getLineNumber();
ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
IAddress address = frame.getAddress();
if ( fileName != null && fileName.length() > 0 ) {
try {
mixedInstrs = sm.getMixedInstructions( fileName,
lineNumber,
CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );
}
ICDITarget target = (ICDITarget)getDebugTarget().getAdapter( ICDITarget.class );
if ( target != null ) {
String fileName = frame.getFile();
int lineNumber = frame.getLineNumber();
ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
IAddress address = frame.getAddress();
if ( fileName != null && fileName.length() > 0 ) {
try {
mixedInstrs = target.getMixedInstructions( fileName,
lineNumber,
CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) );
}
// 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( 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 );
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), e );
}
}
// 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;
}