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);
}
Aggregations