Search in sources :

Example 1 with STStrings

use of org.eclipse.linuxtools.binutils.utils.STStrings in project linuxtools by eclipse.

the class CovManager method getGCDALocations.

/**
 * Retrieve a list containing gcda paths from a binary file
 * @return
 * @throws InterruptedException
 */
public List<String> getGCDALocations() throws InterruptedException {
    IBinaryObject binaryObject = STSymbolManager.sharedInstance.getBinaryObject(new Path(binaryPath));
    String binaryPath = binaryObject.getPath().toOSString();
    STStrings strings = STSymbolManager.sharedInstance.getStrings(binaryObject, project);
    List<String> l = new LinkedList<>();
    Process p;
    p = getStringsProcess(strings.getName(), strings.getArgs(), binaryPath);
    if (p == null) {
        Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.CovManager_Retrieval_Error, new IOException());
        Activator.getDefault().getLog().log(status);
        return l;
    }
    ThreadConsumer t = new ThreadConsumer(p, l);
    t.start();
    p.waitFor();
    t.join();
    return l;
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) STStrings(org.eclipse.linuxtools.binutils.utils.STStrings) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IBinaryObject(org.eclipse.cdt.core.IBinaryParser.IBinaryObject) IOException(java.io.IOException) LinkedList(java.util.LinkedList)

Aggregations

IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1 IBinaryObject (org.eclipse.cdt.core.IBinaryParser.IBinaryObject)1 IPath (org.eclipse.core.runtime.IPath)1 IStatus (org.eclipse.core.runtime.IStatus)1 Path (org.eclipse.core.runtime.Path)1 Status (org.eclipse.core.runtime.Status)1 STStrings (org.eclipse.linuxtools.binutils.utils.STStrings)1