Search in sources :

Example 6 with ISymbol

use of org.eclipse.cdt.core.IBinaryParser.ISymbol 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)

Example 7 with ISymbol

use of org.eclipse.cdt.core.IBinaryParser.ISymbol in project linuxtools by eclipse.

the class CGArc method getFunctionName.

public String getFunctionName() {
    Object o = this.getParent();
    CGCategory category = (CGCategory) o;
    ISymbol symbol;
    if (CGCategory.CHILDREN.equals(category.category)) {
        symbol = arc.child.getSymbol();
    } else {
        symbol = arc.parent.getSymbol();
    }
    return STSymbolManager.sharedInstance.demangle(symbol, arc.getProject());
}
Also used : ISymbol(org.eclipse.cdt.core.IBinaryParser.ISymbol)

Example 8 with ISymbol

use of org.eclipse.cdt.core.IBinaryParser.ISymbol in project linuxtools by eclipse.

the class CGArc method getSourcePath.

@Override
public String getSourcePath() {
    Object o = this.getParent();
    CGCategory category = (CGCategory) o;
    if (CGCategory.CHILDREN.equals(category.category)) {
        ISymbol symbol = arc.child.getSymbol();
        return ((HistRoot) getRoot()).decoder.getFileName(symbol);
    } else {
        if (arc.parentPath == null) {
            // $NON-NLS-1$
            return "??";
        }
        return arc.parentPath;
    }
}
Also used : ISymbol(org.eclipse.cdt.core.IBinaryParser.ISymbol)

Example 9 with ISymbol

use of org.eclipse.cdt.core.IBinaryParser.ISymbol in project linuxtools by eclipse.

the class HistRoot method addCallGraphNode.

/**
 * Add a callgraph node to the tree representation of the gmon file
 * @param node
 */
public void addCallGraphNode(CallGraphNode node) {
    ISymbol s = node.getSymbol();
    String path = decoder.getFileName(s);
    HistFile hf = getChild(path);
    hf.addCallGraphNode(node);
}
Also used : ISymbol(org.eclipse.cdt.core.IBinaryParser.ISymbol)

Aggregations

ISymbol (org.eclipse.cdt.core.IBinaryParser.ISymbol)9 IAddress (org.eclipse.cdt.core.IAddress)2 IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1 IAddressFactory (org.eclipse.cdt.core.IAddressFactory)1 IBinaryObject (org.eclipse.cdt.core.IBinaryParser.IBinaryObject)1 BinaryObjectAdapter (org.eclipse.cdt.utils.BinaryObjectAdapter)1 Symbol (org.eclipse.cdt.utils.Symbol)1 Elf (org.eclipse.cdt.utils.elf.Elf)1 Bucket (org.eclipse.linuxtools.internal.gprof.symbolManager.Bucket)1