Community
Participate
Working Groups
There are a number of places in the CDT where org.eclipse.core.runtime.Platform.getOSArch() is called to find out what the machine architecture is so that it can determine if, for example, gdb can debug a particular executable. On most platforms so far, just calling getOSArch has worked fine because typically people run a 64-bit Eclipse + JVM when running on x86_64, and a 32-bit Eclipse when running on x86. However, there is a different situation on PowerPC where many of the newer machines are 64-bit, but there is only one 32-bit Eclipse built for PowerPC. So when the CDT call getOSArch on PowerPC, it always returns "ppc" regardless of whether or not the machine is actually "ppc64". At first I proposed a change to org.eclipse.core.runtime.Platform.getOSArch() so that it would return a more accurate OS architecture value... in the PowerPC case, "ppc64" (when appropriate of course). However, this idea was rejected by the Eclipse core team because they want that value to reflect what the osgi layer says the machine is. My new proposal is to introduce a new class in org.eclipse.cdt.utils called Platform. It will mimic what the org.eclipse.core.runtime.Platform class does, except that it will return a more accurate value for getOSArch(). I will attach a proposed org.eclipse.cdt.utils.Platform implementation.
Created attachment 49216 [details] More accurate version of org.eclipse.core.runtime.Platform.getOSArch for the CDT This is a version of Platform for the CDT that extends getOSArch to more accurately detect the Platform's architecture. The class offers all of the methods and constants that are currently used in the CDT, but leaves the unused ones out. I would have just "extended" org.eclipse.core.runtime.Platform, but the latter is marked as final. It's not clear to me that this is the best solution, to offer a partial clone of org.eclipse.core.runtime.Platform, but it makes the modifications to the CDT classes that currently use org.eclipse.core.runtime.Platform simple - just a change of import.
The patch had been applied for 3.1.2.