Search in sources :

Example 1 with IAddressFactory

use of org.eclipse.cdt.core.IAddressFactory in project linuxtools by eclipse.

the class CallGraphDecoder method decodeCallGraphRecord.

/**
 * Decode call-graph record from gmon file.
 * @param stream
 * @throws IOException
 */
public void decodeCallGraphRecord(DataInput stream, boolean bsdFormat) throws IOException {
    long from_pc = readAddress(stream);
    long self_pc = readAddress(stream);
    int count = bsdFormat ? (int) readAddress(stream) : stream.readInt();
    IBinaryObject program = decoder.getProgram();
    IAddressFactory addressFactory = program.getAddressFactory();
    IAddress parentAddress = addressFactory.createAddress(Long.toString(from_pc));
    ISymbol parentSymbol = program.getSymbol(parentAddress);
    IAddress childAddress = addressFactory.createAddress(Long.toString(self_pc));
    ISymbol childSymbol = program.getSymbol(childAddress);
    if (childSymbol == null || parentSymbol == null) {
        return;
    }
    addCallArc(parentSymbol, parentAddress, childSymbol, count);
}
Also used : IAddressFactory(org.eclipse.cdt.core.IAddressFactory) ISymbol(org.eclipse.cdt.core.IBinaryParser.ISymbol) IBinaryObject(org.eclipse.cdt.core.IBinaryParser.IBinaryObject) IAddress(org.eclipse.cdt.core.IAddress)

Aggregations

IAddress (org.eclipse.cdt.core.IAddress)1 IAddressFactory (org.eclipse.cdt.core.IAddressFactory)1 IBinaryObject (org.eclipse.cdt.core.IBinaryParser.IBinaryObject)1 ISymbol (org.eclipse.cdt.core.IBinaryParser.ISymbol)1