use of org.eclipse.cdt.core.IBinaryParser.IBinaryObject 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.IBinaryParser.IBinaryObject 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.IBinaryParser.IBinaryObject in project linuxtools by eclipse.
the class OpenGCDialog method validateBinary.
private void validateBinary() {
binValue = binText.getText();
IStringVariableManager mgr = VariablesPlugin.getDefault().getStringVariableManager();
try {
binValue = mgr.performStringSubstitution(binValue, false);
} catch (CoreException e) {
// do nothing: never occurs
}
File f = new File(binValue);
if (f.exists()) {
IBinaryObject binary = STSymbolManager.sharedInstance.getBinaryObject(new Path(binValue));
if (binary == null) {
MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), Messages.OpenGCDialog_invalid_bin_error_title, NLS.bind(Messages.OpenGCDialog_invalid_bin_error_message, binText.getText()));
return;
}
binaryValid = true;
getButton(IDialogConstants.OK_ID).setEnabled(binaryValid);
// $NON-NLS-1$
errorLabel.setText("");
} else {
binaryValid = false;
getButton(IDialogConstants.OK_ID).setEnabled(false);
if (!binValue.isEmpty()) {
errorLabel.setText(NLS.bind(Messages.OpenGCDialog_bin_dne_error_label, binText.getText()));
} else {
errorLabel.setText(Messages.OpenGCDialog_no_bin_error_label);
}
return;
}
}
use of org.eclipse.cdt.core.IBinaryParser.IBinaryObject in project linuxtools by eclipse.
the class CovManager method fillGcovView.
/**
* fill the model by count results
* @throws CoreException, IOException, InterruptedException
*/
public void fillGcovView() {
// process counts for summary level
int summaryTotal = 0, summaryInstrumented = 0, summaryExecuted = 0;
for (Folder f : allFolders) {
summaryTotal += f.getNumLines();
summaryInstrumented += f.getLinesInstrumented();
summaryExecuted += f.getLinesExecuted();
}
// fill rootNode model: the entry of the contentProvider
rootNode = new CovRootTreeElement(Messages.CovManager_Summary, summaryTotal, summaryExecuted, summaryInstrumented);
IBinaryObject binaryObject = STSymbolManager.sharedInstance.getBinaryObject(new Path(binaryPath));
for (Folder fldr : allFolders) {
String folderLocation = fldr.getPath();
CovFolderTreeElement fldrTreeElem = new CovFolderTreeElement(rootNode, folderLocation, fldr.getNumLines(), fldr.getLinesExecuted(), fldr.getLinesInstrumented());
rootNode.addChild(fldrTreeElem);
for (SourceFile src : fldr.getSrcFiles()) {
CovFileTreeElement srcTreeElem = new CovFileTreeElement(fldrTreeElem, src.getName(), src.getNumLines(), src.getLinesExecuted(), src.getLinesInstrumented());
fldrTreeElem.addChild(srcTreeElem);
for (GcnoFunction fnctn : src.getFnctns()) {
String name = fnctn.getName();
name = STSymbolManager.sharedInstance.demangle(binaryObject, name, project);
srcTreeElem.addChild(new CovFunctionTreeElement(srcTreeElem, name, fnctn.getSrcFile(), fnctn.getFirstLineNmbr(), fnctn.getCvrge().getLinesExecuted(), fnctn.getCvrge().getLinesInstrumented()));
}
}
}
}
use of org.eclipse.cdt.core.IBinaryParser.IBinaryObject in project linuxtools by eclipse.
the class GprofParserTest method testProcessGmonFile.
@Test
public void testProcessGmonFile() throws IOException {
IBinaryObject binary = STSymbolManager.sharedInstance.getBinaryObject(binaryFile.getAbsolutePath());
final GmonDecoder gmondecoder = new GmonDecoder(binary, new PrintStream(parserDumpFile), null);
gmondecoder.setShouldDump(true);
gmondecoder.read(gmonFile.getAbsolutePath());
STJunitUtils.compareIgnoreEOL(parserDumpFile.getAbsolutePath(), parserRefFile.getAbsolutePath(), true);
}
Aggregations