1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

A class to return a mixed of source and assembly instructions.

This commit is contained in:
Alain Magloire 2002-10-12 01:21:29 +00:00
parent 9c134355a8
commit c87597043b
3 changed files with 86 additions and 0 deletions

View file

@ -4,6 +4,13 @@
2002-10-11 Mikhail Khodjaiants
* DisassemblyStorage.java: Changed the format of the disassembly view's output.
2002-10-11 Alain Magloire
* ICDISourceManager.java (getMixedInstructions): Three
new methods to get the src and the intructions.
* ICIDMixedInstruction: New Class that return the mixed
of source location and assembly instructions.
2002-10-10 Mikhail Khodjaiants
* CVariable.java: Made the 'fChanged' field protected to access to it from the derived class (CRegister).

View file

@ -0,0 +1,29 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.core.cdi.model;
/**
*
* Represents a machine instruction.
*
* @since Jul 10, 2002
*/
public interface ICDIMixedInstruction extends ICDIObject {
/**
* @return the line Number.
*/
int getLineNumber();
/**
* @return the file name
*/
String getFileName();
/**
* @return the array of instruction.
*/
ICDIInstruction[] getInstructions();
}

View file

@ -0,0 +1,50 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.cdi;
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
import org.eclipse.cdt.debug.mi.core.output.MIAsm;
import org.eclipse.cdt.debug.mi.core.output.MISrcAsm;
/**
*/
public class MixedInstruction extends CObject implements ICDIMixedInstruction {
MISrcAsm srcAsm;
public MixedInstruction (CTarget target, MISrcAsm a) {
super(target);
srcAsm = a;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction#getFileName()
*/
public String getFileName() {
return srcAsm.getFile();
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction#getInstructions()
*/
public ICDIInstruction[] getInstructions() {
MIAsm[] asms = srcAsm.getMIAsms();
ICDIInstruction[] instructions = new ICDIInstruction[asms.length];
for (int i = 0; i < asms.length; i++) {
instructions[i] = new Instruction(getCTarget(), asms[i]);
}
return instructions;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction#getLineNumber()
*/
public int getLineNumber() {
return srcAsm.getLine();
}
}