Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWainer dos Santos Moschetta2016-09-06 20:36:37 +0000
committerJeff Johnston2016-09-07 17:56:50 +0000
commit9dfb2da94d14d3ede0e06ae0feaeba4779c59566 (patch)
treeb2273e47bf3caa9ced74325d4f7e3bf21bbc5fc1
parent15142db72148e2b01292f8a61f1ca013c175ff72 (diff)
downloadorg.eclipse.linuxtools-9dfb2da94d14d3ede0e06ae0feaeba4779c59566.tar.gz
org.eclipse.linuxtools-9dfb2da94d14d3ede0e06ae0feaeba4779c59566.tar.xz
org.eclipse.linuxtools-9dfb2da94d14d3ede0e06ae0feaeba4779c59566.zip
Bug 500446: fix gprof parsing of PPC64 LE objects
On PowerPC64 LE (Little Endian) platform, gprof was evoking PPC64ElfBinaryObjectWrapper to handle binary' symbols. However, PPC64ElfBinaryObjectWrapper is designed to handle BE (Big Endian) objects only. Change-Id: Idd7549b0ff4775497b45413b5be89d11088baf36 Signed-off-by: Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com> Reviewed-on: https://git.eclipse.org/r/80529 Tested-by: Hudson CI (cherry picked from commit da3996e7af35e685a0c7f465b3b699fcfbb9d608) Reviewed-on: https://git.eclipse.org/r/80608 Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java3
-rw-r--r--gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java
index 69f727123c..b1573a9b8d 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java
@@ -26,6 +26,9 @@ import org.eclipse.cdt.utils.elf.Elf;
import org.eclipse.cdt.utils.elf.parser.ElfBinaryObject;
import org.eclipse.core.runtime.IPath;
+/**
+ * Represents a PowerPC64 BE (Big Endian) binary object.
+ */
public class PPC64ElfBinaryObjectWrapper extends ElfBinaryObject {
private Elf.Section dataSection = null;
private ISymbol[] symbols = null;
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java
index 955601288e..71b6f8360f 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java
@@ -241,8 +241,9 @@ public class GmonView extends AbstractSTDataView {
MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Invalid binary file", //$NON-NLS-1$
binaryPath + " is not a valid binary file."); //$NON-NLS-1$
return null;
- } else if (binary.getCPU().equals("ppc64")) //$NON-NLS-1$
+ } 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 {

Back to the top