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 167244 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
[patch]
Patch v2
149994.txt (text/plain), 6.58 KB, created by
Andrew Niefer
on 2010-05-05 18:50:51 EDT
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2010-05-05 18:50:51 EDT
Size:
6.58 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 >diff -u -r1.72 eclipse.c >--- library/eclipse.c 17 Mar 2010 17:47:35 -0000 1.72 >+++ library/eclipse.c 5 May 2010 22:28:43 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 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 >@@ -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.stickyVmargs > *******************************************************************************/ > > /* Eclipse Program Launcher >@@ -233,6 +234,7 @@ > #define LIBRARY _T_ECLIPSE("--launcher.library") > #define SUPRESSERRORS _T_ECLIPSE("--launcher.suppressErrors") > #define INI _T_ECLIPSE("--launcher.ini") >+#define STICKYVMARGS _T_ECLIPSE("--launcher.stickyVmargs") > #define SECOND_THREAD _T_ECLIPSE("--launcher.secondThread") > #define PERM_GEN _T_ECLIPSE("--launcher.XXMaxPermSize") > >@@ -299,6 +301,7 @@ > { SECOND_THREAD, &secondThread, VALUE_IS_FLAG, 1 }, > { LIBRARY, NULL, 0, 2 }, /* library was parsed by exe, just remove it */ > { INI, NULL, 0, 2 }, /* same with ini */ >+ { STICKYVMARGS, NULL, 0, 2 }, /* same with --launcher.stickyVmargs */ > { OS, &osArg, 0, 2 }, > { OSARCH, &osArchArg, 0, 2 }, > { SHOWSPLASH, &showSplashArg, OPTIONAL_VALUE, 2 }, >Index: library/eclipseMain.c >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.equinox.executable/library/eclipseMain.c,v >retrieving revision 1.28 >diff -u -r1.28 eclipseMain.c >--- library/eclipseMain.c 14 Dec 2009 19:17:52 -0000 1.28 >+++ library/eclipseMain.c 5 May 2010 22:28:43 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 > * Andrew Niefer >+ * Martin Oberhuber (Wind River) - [149994] Add --launcher.stickyVmargs > *******************************************************************************/ > > #include "eclipseUnicode.h" >@@ -35,6 +36,7 @@ > #define LIBRARY _T_ECLIPSE("--launcher.library") > #define SUPRESSERRORS _T_ECLIPSE("--launcher.suppressErrors") > #define INI _T_ECLIPSE("--launcher.ini") >+#define STICKYVMARGS _T_ECLIPSE("--launcher.stickyVmargs") > > /* this typedef must match the run method in eclipse.c */ > typedef int (*RunMethod)(int argc, _TCHAR* argv[], _TCHAR* vmArgs[]); >@@ -42,9 +44,11 @@ > > static _TCHAR* name = NULL; /* program name */ > static _TCHAR** userVMarg = NULL; /* user specific args for the Java VM */ >+static _TCHAR** configVMarg = NULL; /* vmargs specified in the ini file */ > static _TCHAR* programDir = NULL; /* directory where program resides */ > static _TCHAR* officialName = NULL; > static int suppressErrors = 0; /* supress error dialogs */ >+static int stickyVmargs = 0; /* append cmdline vmargs to ini vmargs */ > > static int createUserArgs(int configArgc, _TCHAR **configArgv, int *argc, _TCHAR ***argv); > static void parseArgs( int* argc, _TCHAR* argv[] ); >@@ -52,6 +56,7 @@ > static _TCHAR* findProgram(_TCHAR* argv[]); > static _TCHAR* findLibrary(_TCHAR* library, _TCHAR* program); > static _TCHAR* checkForIni(int argc, _TCHAR* argv[]); >+static _TCHAR** concatArgs(_TCHAR* l1[], _TCHAR* l2[]); > > static int initialArgc; > static _TCHAR** initialArgv; >@@ -98,6 +103,7 @@ > _TCHAR* ch; > _TCHAR** configArgv = NULL; > int configArgc = 0; >+ int vmArgsAllocated = 0; > int exitCode = 0; > int ret = 0; > void * handle = 0; >@@ -134,20 +140,26 @@ > if (ret == 0) > { > parseArgs (&configArgc, configArgv); >+ configVMarg = userVMarg; > } > > /* Parse command line arguments */ > /* Overrides configuration file arguments */ > parseArgs( &argc, argv ); > >- /* Special case - user arguments specified in the config file >- * are appended to the user arguments passed from the command line. >+ /* Special case - user arguments specified in the command line >+ * are appended to the user arguments passed from the config file. > */ > if (configArgc > 0) > { > createUserArgs(configArgc, configArgv, &argc, &argv); > } > >+ if (stickyVmargs && configVMarg != NULL && configVMarg != userVMarg) { >+ userVMarg = concatArgs(configVMarg, userVMarg); >+ vmArgsAllocated = 1; >+ } >+ > /* Initialize official program name */ > officialName = name != NULL ? _tcsdup( name ) : getDefaultOfficialName(program); > >@@ -197,6 +209,8 @@ > free( programDir ); > free( program ); > free( officialName ); >+ if (vmArgsAllocated) >+ free(userVMarg); > > return exitCode; > } >@@ -261,10 +275,36 @@ > eclipseLibrary = argv[++index]; > } else if(_tcsicmp(argv[index], SUPRESSERRORS) == 0) { > suppressErrors = 1; >+ } else if(_tcsicmp(argv[index], STICKYVMARGS) == 0) { >+ stickyVmargs = 1; > } > } > } > >+/* Concat arglist l1 with arglist l2, returning a new list. >+ * Caller is responsible for freeing up the new list. >+ */ >+static _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; >+} >+ > /* We need to look for --launcher.ini before parsing the other args */ > static _TCHAR* checkForIni(int argc, _TCHAR* argv[]) > {
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 149994
:
167132
|
167244
|
167258
|
167367
|
167368
|
167413
|
167418
|
172145
|
176334
|
176336
|
176387
|
176582
|
177261
|
177356