Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 176387 Details for
Bug 149994
[launcher] part of eclipse.ini (vmargs) are ignored if -vmargs is used on the command line too
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
v9
149994.txt (text/plain), 10.20 KB, created by
Andrew Niefer
on 2010-08-11 14:39:55 EDT
(
hide
)
Description:
v9
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2010-08-11 14:39:55 EDT
Size:
10.20 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.executable >Index: library/eclipse.c >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.equinox.executable/library/eclipse.c,v >retrieving revision 1.72.2.1 >diff -u -r1.72.2.1 eclipse.c >--- library/eclipse.c 10 Aug 2010 19:43:00 -0000 1.72.2.1 >+++ library/eclipse.c 11 Aug 2010 18:38:26 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Kevin Cornell (Rational Software Corporation) > * Markus Schorn (Wind River Systems), bug 193340 >+ * Martin Oberhuber (Wind River) - [149994] Add --launcher.appendVmargs > *******************************************************************************/ > > /* Eclipse Program Launcher >@@ -233,6 +234,8 @@ > #define LIBRARY _T_ECLIPSE("--launcher.library") > #define SUPRESSERRORS _T_ECLIPSE("--launcher.suppressErrors") > #define INI _T_ECLIPSE("--launcher.ini") >+#define APPEND_VMARGS _T_ECLIPSE("--launcher.appendVmargs") >+#define OVERRIDE_VMARGS _T_ECLIPSE("--launcher.overrideVmargs") > #define SECOND_THREAD _T_ECLIPSE("--launcher.secondThread") > #define PERM_GEN _T_ECLIPSE("--launcher.XXMaxPermSize") > >@@ -254,6 +257,7 @@ > static int noSplash = 0; /* True: do not show splash win */ > static int suppressErrors = 0; /* True: do not display errors dialogs */ > int secondThread = 0; /* True: start the VM on a second thread */ >+static int appendVmargs = 0; /* True: append cmdline vmargs to launcher.ini vmargs */ > > static _TCHAR* showSplashArg = NULL; /* showsplash data (main launcher window) */ > static _TCHAR* splashBitmap = NULL; /* the actual splash bitmap */ >@@ -289,6 +293,7 @@ > /* don't assign it and only remove (remove - 1) arguments */ > #define ADJUST_PATH 4 /* value is a path, do processing on relative paths to try and make them absolute */ > #define VALUE_IS_LIST 8 /* value is a pointer to a tokenized _TCHAR* string for EE files, or a _TCHAR** list for the command line */ >+#define INVERT_FLAG 16 /* invert the meaning of a flag, i.e. reset it */ > > static Option options[] = { > { CONSOLE, &needConsole, VALUE_IS_FLAG, 0 }, >@@ -297,6 +302,8 @@ > { NOSPLASH, &noSplash, VALUE_IS_FLAG, 1 }, > { SUPRESSERRORS, &suppressErrors, VALUE_IS_FLAG, 1}, > { SECOND_THREAD, &secondThread, VALUE_IS_FLAG, 1 }, >+ { APPEND_VMARGS, &appendVmargs, VALUE_IS_FLAG, 1 }, >+ { OVERRIDE_VMARGS, &appendVmargs, VALUE_IS_FLAG | INVERT_FLAG, 1 }, > { LIBRARY, NULL, 0, 2 }, /* library was parsed by exe, just remove it */ > { INI, NULL, 0, 2 }, /* same with ini */ > { OS, &osArg, 0, 2 }, >@@ -331,6 +338,7 @@ > /* Local methods */ > static void parseArgs( int* argc, _TCHAR* argv[] ); > static void processDefaultAction(int argc, _TCHAR* argv[]); >+static void mergeUserVMArgs( _TCHAR **vmArgs[] ); > static void getVMCommand( int launchMode, int argc, _TCHAR* argv[], _TCHAR **vmArgv[], _TCHAR **progArgv[] ); > static int determineVM(_TCHAR** msg); > static int vmEEProps(_TCHAR* eeFile, _TCHAR** msg); >@@ -422,8 +430,13 @@ > exit( 1 ); > } > >- /* platform specific processing of user's vmargs */ >- processVMArgs(&vmArgs); >+ if (vmArgs != NULL) { >+ /* reconcile VM Args from commandline with launcher.ini (append or override), >+ * this always allocate new memory */ >+ mergeUserVMArgs(&vmArgs); >+ /* platform specific processing of user's vmargs */ >+ processVMArgs(&vmArgs); >+ } > launchMode = determineVM(&msg); > if (launchMode == -1) { > /* problem */ >@@ -641,6 +654,7 @@ > if ( cpValue != NULL) free( cpValue ); > if ( exitData != NULL ) free( exitData ); > if ( splashBitmap != NULL ) free( splashBitmap ); >+ if (vmArgs != NULL) free(vmArgs); > > if (javaResults == NULL) > return -1; >@@ -720,7 +734,7 @@ > /* If the option requires a value and there is one, extract the value. */ > if (option->value != NULL) { > if (option->flag & VALUE_IS_FLAG) >- *((int *) option->value) = 1; >+ *((int *) option->value) = (option->flag & INVERT_FLAG) ? 0 : 1; > else { > int count = 1; > if (option->flag & VALUE_IS_LIST) { >@@ -796,9 +810,55 @@ > return execArg; > } > >+/* Return the list of args from the launcher ini file (if it exists). Caller is responsible to free(). */ >+static _TCHAR** getConfigArgs() { >+ _TCHAR* iniFile = NULL; >+ _TCHAR** configArgv = NULL; >+ int configArgc = 0; >+ int ret = 0; >+ int iniArg; >+ >+ /* Parse configuration file arguments */ >+ iniArg = indexOf(INI, initialArgv); >+ if (iniArg > 0) { >+ iniFile = initialArgv[iniArg + 1]; >+ ret = readConfigFile(iniFile, &configArgc, &configArgv); >+ } else { >+ ret = readIniFile(program, &configArgc, &configArgv); >+ } >+ if (ret == 0) { >+ return configArgv; >+ } >+ return NULL; >+} >+ >+/** Append Commandline VM Args to VM Args that came from the launcher.ini >+ * Always returns new memory even if no new arguments were appended */ >+static void mergeUserVMArgs(_TCHAR **vmArgs[]) { >+ _TCHAR** configVMArgs = NULL; >+ _TCHAR** configArgs = NULL; >+ >+ if (appendVmargs != 0 && indexOf(VMARGS, initialArgv) > 0) { >+ /* Get vmargs from the launcher.ini, if any */ >+ configArgs = getConfigArgs(); >+ if (configArgs != NULL) { >+ int vmArg = indexOf(VMARGS, configArgs); >+ if (vmArg >= 0) >+ configVMArgs = configArgs + vmArg + 1; >+ } >+ } >+ >+ /* This always allocates new memory so we don't need to guess if it is safe >+ * to free later */ >+ *vmArgs = concatArgs(configVMArgs, *vmArgs); >+ if (configArgs != NULL) >+ free(configArgs); >+} >+ > static void adjustVMArgs( _TCHAR *javaVM, _TCHAR *jniLib, _TCHAR **vmArgv[] ) { > /* Sun VMs need some extra perm gen space */ >- if (permGen != NULL && isSunVM(javaVM, jniLib)) { >+ /* Detecting Sun VM is expensive - only do so if necessary */ >+ if (permGen != NULL) { > int specified = 0, i = -1; > > /* first check to see if it is already specified */ >@@ -809,7 +869,7 @@ > } > } > >- if (!specified) { >+ if (!specified && isSunVM(javaVM, jniLib)) { > _TCHAR ** oldArgs = *vmArgv; > _TCHAR *newArg = malloc((_tcslen(XXPERMGEN) + _tcslen(permGen) + 1) * sizeof(_TCHAR)); > _stprintf(newArg, _T_ECLIPSE("%s%s"), XXPERMGEN, permGen); >Index: library/eclipseUtil.c >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.equinox.executable/library/eclipseUtil.c,v >retrieving revision 1.13 >diff -u -r1.13 eclipseUtil.c >--- library/eclipseUtil.c 8 Feb 2010 20:58:29 -0000 1.13 >+++ library/eclipseUtil.c 11 Aug 2010 18:38:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Kevin Cornell (Rational Software Corporation) >+ * Martin Oberhuber (Wind River) - [149994] Add --launcher.appendVmargs > *******************************************************************************/ > > /* Eclipse Launcher Utility Methods */ >@@ -159,6 +160,48 @@ > } > > /* >+ * Concatenates two NULL-terminated arrays of Strings, >+ * returning a new NULL-terminated array. >+ * The returned array must be freed with the regular free(). >+ */ >+_TCHAR** concatArgs(_TCHAR** l1, _TCHAR** l2) { >+ _TCHAR** newArray = NULL; >+ int size1 = 0; >+ int size2 = 0; >+ >+ if (l1 != NULL) >+ while (l1[size1] != NULL) size1++; >+ if (l2 != NULL) >+ while (l2[size2] != NULL) size2++; >+ >+ newArray = (_TCHAR **) malloc((size1 + size2 + 1) * sizeof(_TCHAR *)); >+ if (size1 > 0) { >+ memcpy(newArray, l1, size1 * sizeof(_TCHAR *)); >+ } >+ if (size2 > 0) { >+ memcpy(newArray + size1, l2, size2 * sizeof(_TCHAR *)); >+ } >+ newArray[size1 + size2] = NULL; >+ return newArray; >+} >+ >+/* >+ * returns the relative position of arg in the NULL-terminated list of args, >+ * or -1 if args does not contain arg. >+ */ >+int indexOf(_TCHAR *arg, _TCHAR **args) { >+ int i = -1; >+ if (arg != NULL && args != NULL) { >+ while (args[++i] != NULL) { >+ if (_tcsicmp(arg, args[i]) == 0) { >+ return i; >+ } >+ } >+ } >+ return -1; >+} >+ >+/* > * buffer contains a pathSeparator separated list of paths, check > * that it contains all the paths given. Each path is expected to be > * terminated with a pathSeparator character. >Index: library/eclipseUtil.h >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.equinox.executable/library/eclipseUtil.h,v >retrieving revision 1.8 >diff -u -r1.8 eclipseUtil.h >--- library/eclipseUtil.h 8 Feb 2010 20:58:28 -0000 1.8 >+++ library/eclipseUtil.h 11 Aug 2010 18:38:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Kevin Cornell (Rational Software Corporation) >+ * Martin Oberhuber (Wind River) - [149994] Add --launcher.appendVmargs > *******************************************************************************/ > > #ifndef ECLIPSE_UTIL_H >@@ -37,6 +38,12 @@ > /* take a NULL terminated array of strings and concatenate them together into one string */ > extern _TCHAR * concatStrings(_TCHAR** strs); > >+/* Concatenates two NULL-terminated arrays of strings into a new array of strings */ >+extern _TCHAR** concatArgs(_TCHAR** l1, _TCHAR** l2); >+ >+/* Returns the relative position of arg in the NULL-terminated list of args, or -1 */ >+extern int indexOf(_TCHAR *arg, _TCHAR **args); >+ > /* take a NULL terminated array of strings and concatenate them together using the give pathSeparator */ > extern _TCHAR* concatPaths(_TCHAR** paths, _TCHAR pathSeparator); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 149994
:
167132
|
167244
|
167258
|
167367
|
167368
|
167413
|
167418
|
172145
|
176334
|
176336
|
176387
|
176582
|
177261
|
177356