use of org.eclipse.cdt.utils.BinaryObjectAdapter 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;
}
Aggregations