use of org.eclipse.cdt.core.IAddress in project linuxtools by eclipse.
the class STSymbolManager method getLineNumber.
/**
* @param symbol
* @param project
* @return the line number of the given symbol
*/
public int getLineNumber(ISymbol symbol, IProject project) {
IBinaryObject obj = symbol.getBinaryObject();
IAddress address = symbol.getAddress();
return getLineNumber(obj, address, project);
}
use of org.eclipse.cdt.core.IAddress in project linuxtools by eclipse.
the class STSymbolManager method getFilename.
/**
* @param symbol
* @param project
* @return the filename of the given symbol
*/
public String getFilename(ISymbol symbol, IProject project) {
IBinaryObject obj = symbol.getBinaryObject();
IAddress address = symbol.getAddress();
return getFileName(obj, address, project);
}
use of org.eclipse.cdt.core.IAddress in project linuxtools by eclipse.
the class PPC64ElfBinaryObjectWrapper method getSymbols.
@Override
public ISymbol[] getSymbols() {
if (symbols != null) {
return symbols;
}
symbols = super.getSymbols();
try {
if (dataSection == null) {
Elf elf = new Elf(getPath().toOSString());
// $NON-NLS-1$
dataSection = elf.getSectionByName(".data");
}
} catch (IOException e) {
}
// Failed to load data Section
if (dataSection == null) {
return symbols;
}
LinkedList<ISymbol> list = new LinkedList<>();
for (ISymbol s : symbols) {
if (s.getType() == ISymbol.FUNCTION && s instanceof Symbol) {
IAddress addr = fixAddr(s.getAddress());
if (addr == null) {
addr = s.getAddress();
}
list.add(new Symbol((BinaryObjectAdapter) s.getBinaryObject(), s.getName(), s.getType(), addr, s.getSize()));
} else {
list.add(s);
}
}
symbols = list.toArray(new Symbol[0]);
Arrays.sort(symbols);
return symbols;
}
use of org.eclipse.cdt.core.IAddress 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);
}
use of org.eclipse.cdt.core.IAddress in project linuxtools by eclipse.
the class HistFunction method addBucket.
void addBucket(Bucket b, IBinaryObject program) {
int lineNumber = -1;
IAddress address = program.getAddressFactory().createAddress(String.valueOf(b.startAddr));
lineNumber = STSymbolManager.sharedInstance.getLineNumber(program, address, getProject());
HistLine hf = getChild(lineNumber);
hf.addBucket(b);
histSym.put(symbol, b.time + histSym.get(symbol));
}
Aggregations