Search in sources :

Example 1 with PPC64ElfBinaryObjectWrapper

use of org.eclipse.linuxtools.internal.gprof.utils.PPC64ElfBinaryObjectWrapper in project linuxtools by eclipse.

the class GmonView method displayGprofView.

/**
 * Display gmon results in the GProf View. NOTE: this method has to be called from within the UI thread.
 *
 * @param binaryPath
 * @param gmonPath
 * @param instanceName
 */
public static GmonView displayGprofView(String binaryPath, String gmonPath, IProject project) {
    IBinaryObject binary = STSymbolManager.sharedInstance.getBinaryObject(new Path(binaryPath));
    if (binary == null) {
        // $NON-NLS-1$
        MessageDialog.openError(// $NON-NLS-1$
        PlatformUI.getWorkbench().getDisplay().getActiveShell(), // $NON-NLS-1$
        "Invalid binary file", // $NON-NLS-1$
        binaryPath + " is not a valid binary file.");
        return null;
    } else if (binary.getCPU().equals("ppc64") && !binary.isLittleEndian()) {
        // $NON-NLS-1$
        binary = new PPC64ElfBinaryObjectWrapper(binary.getBinaryParser(), binary.getPath(), binary.getType());
    }
    GmonDecoder decoder = new GmonDecoder(binary, project);
    try {
        decoder.read(gmonPath);
    } catch (IOException e) {
        Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, e.getMessage(), e);
        Activator.getDefault().getLog().log(status);
    }
    return displayGprofView(decoder, gmonPath);
}
Also used : Path(org.eclipse.core.runtime.Path) PPC64ElfBinaryObjectWrapper(org.eclipse.linuxtools.internal.gprof.utils.PPC64ElfBinaryObjectWrapper) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) GmonDecoder(org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder) IBinaryObject(org.eclipse.cdt.core.IBinaryParser.IBinaryObject) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 IBinaryObject (org.eclipse.cdt.core.IBinaryParser.IBinaryObject)1 IStatus (org.eclipse.core.runtime.IStatus)1 Path (org.eclipse.core.runtime.Path)1 Status (org.eclipse.core.runtime.Status)1 GmonDecoder (org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder)1 PPC64ElfBinaryObjectWrapper (org.eclipse.linuxtools.internal.gprof.utils.PPC64ElfBinaryObjectWrapper)1