Bug 155878 - CDT needs to know the exact architecture it's running on, not what the JVM thinks it is
Summary: CDT needs to know the exact architecture it's running on, not what the JVM th...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 3.1.1   Edit
Hardware: Power PC Linux
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 152656 148415
  Show dependency tree
 
Reported: 2006-08-31 14:50 EDT by Corey Ashford CLA
Modified: 2007-06-22 06:50 EDT (History)
0 users

See Also:


Attachments
More accurate version of org.eclipse.core.runtime.Platform.getOSArch for the CDT (2.69 KB, text/plain)
2006-08-31 16:53 EDT, Corey Ashford CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Corey Ashford CLA 2006-08-31 14:50:01 EDT
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.
Comment 1 Corey Ashford CLA 2006-08-31 16:53:52 EDT
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.
Comment 2 Markus Schorn CLA 2007-06-22 06:50:53 EDT
The patch had been applied for 3.1.2.