From 2443840af6e1e89641c4ae20ab23767314576337 Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 3 Jan 2018 14:50:38 +0100 Subject: [PATCH 1/6] No more PharoVM difference for VM usage --- platforms/win32/vm/sqWin32Window.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/platforms/win32/vm/sqWin32Window.c b/platforms/win32/vm/sqWin32Window.c index d5393e6982..fc53efd3a6 100644 --- a/platforms/win32/vm/sqWin32Window.c +++ b/platforms/win32/vm/sqWin32Window.c @@ -3287,14 +3287,10 @@ void HideSplashScreen(void) { } /****************************************************************************/ -/* Usage of Squeak */ +/* Usage of Open Smalltalk VM */ /****************************************************************************/ -#ifdef PharoVM -# define VMOPTION(arg) "--"arg -#else # define VMOPTION(arg) "-"arg -#endif /* print usage with different output levels */ int printUsage(int level) From 841e01a749b9bd6296c4d29d380b209f65406adb Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 3 Jan 2018 14:51:38 +0100 Subject: [PATCH 2/6] Restore -service: usage hint --- platforms/win32/vm/sqWin32Window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/win32/vm/sqWin32Window.c b/platforms/win32/vm/sqWin32Window.c index fc53efd3a6..2d3ee27342 100644 --- a/platforms/win32/vm/sqWin32Window.c +++ b/platforms/win32/vm/sqWin32Window.c @@ -3303,9 +3303,9 @@ int printUsage(int level) abortMessage(TEXT("%s\n"), TEXT("Usage: ") TEXT(VM_NAME) TEXT(" [vmOptions] imageFile [imageOptions]\n\n") TEXT("vmOptions:") - /* TEXT("\n\t-service: ServiceName \t(install Squeak as NT service)") */ - TEXT("\n\t") TEXT(VMOPTION("headless")) TEXT(" \t\t(force Squeak to run headless)") - TEXT("\n\t") TEXT(VMOPTION("timephases")) TEXT(" (print start load and run times)") + TEXT("\n\t") TEXT(VMOPTION("service:")) TEXT(" ServiceName \t(install VM as NT service)") + TEXT("\n\t") TEXT(VMOPTION("headless")) TEXT(" \t\t(force VM to run headless)") + TEXT("\n\t") TEXT(VMOPTION("timephases")) TEXT(" \t(print start load and run times)") TEXT("\n\t") TEXT(VMOPTION("log:")) TEXT(" LogFile \t\t(use LogFile for VM messages)") TEXT("\n\t") TEXT(VMOPTION("memory:")) TEXT(" megaByte \t(set memory to megaByte MB)") #if STACKVM || NewspeakVM From adcc41f31530348702040f6914109858e2dc8d4c Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 3 Jan 2018 14:52:28 +0100 Subject: [PATCH 3/6] Tell about alternative syntax for options with argument --- platforms/win32/vm/sqWin32Window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/platforms/win32/vm/sqWin32Window.c b/platforms/win32/vm/sqWin32Window.c index 2d3ee27342..fd67d094ec 100644 --- a/platforms/win32/vm/sqWin32Window.c +++ b/platforms/win32/vm/sqWin32Window.c @@ -3341,6 +3341,7 @@ int printUsage(int level) TEXT("\n\t") TEXT(VMOPTION("logscavenge")) TEXT(" \t(log scavenging to scavenge.log)") #endif TEXT("\n") TEXT("Options begin with single -, but -- prefix is silently accepted") + TEXT("\n") TEXT("Options with arguments -opt:n are also accepted with separators -opt n") ); break; case 2: /* No image found */ From e85a3a6874f585a4ad68a994909a2436b97baa9b Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 3 Jan 2018 14:54:43 +0100 Subject: [PATCH 4/6] Cosmetic: use space not tab like the rest of this file --- platforms/win32/vm/sqWin32Window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/win32/vm/sqWin32Window.c b/platforms/win32/vm/sqWin32Window.c index fd67d094ec..fa92aa3b34 100644 --- a/platforms/win32/vm/sqWin32Window.c +++ b/platforms/win32/vm/sqWin32Window.c @@ -3315,14 +3315,14 @@ int printUsage(int level) TEXT("\n\t") TEXT(VMOPTION("breakmnu:")) TEXT(" string \t(call warning on MNU of sel for debug)") TEXT("\n\t") TEXT(VMOPTION("leakcheck:")) TEXT(" n \t(leak check on GC (1=full,2=incr,3=both))") TEXT("\n\t") TEXT(VMOPTION("eden:")) TEXT(" bytes \t(set eden memory size to bytes)") - TEXT("\n\t") TEXT(VMOPTION("stackpages:")) TEXT(" n \t(use n stack pages)") + TEXT("\n\t") TEXT(VMOPTION("stackpages:")) TEXT(" n \t(use n stack pages)") TEXT("\n\t") TEXT(VMOPTION("numextsems:")) TEXT(" n \t(allow up to n external semaphores)") TEXT("\n\t") TEXT(VMOPTION("checkpluginwrites")) TEXT(" \t(check for writes past end of object in plugins") TEXT("\n\t") TEXT(VMOPTION("noheartbeat")) TEXT(" \t(no heartbeat for debug)") #endif /* STACKVM */ #if STACKVM || NewspeakVM # if COGVM - TEXT("\n\t") TEXT(VMOPTION("trace")) TEXT("[=num]\tenable tracing (optionally to a specific value)\n") + TEXT("\n\t") TEXT(VMOPTION("trace")) TEXT("[=num]\tenable tracing (optionally to a specific value)\n") # else TEXT("\n\t") TEXT(VMOPTION("sendtrace")) TEXT(" \t(trace sends to stdout for debug)") # endif From c8628052e73bc4bedf766554677208355416e343 Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 3 Jan 2018 16:30:02 +0100 Subject: [PATCH 5/6] Provide missing -dpsco:x variant for Windows VM This is documented in usage (-help) but not parsed. --- platforms/win32/vm/sqWin32Main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platforms/win32/vm/sqWin32Main.c b/platforms/win32/vm/sqWin32Main.c index 25348c04b5..3a0c008c3f 100644 --- a/platforms/win32/vm/sqWin32Main.c +++ b/platforms/win32/vm/sqWin32Main.c @@ -1843,15 +1843,19 @@ parseVMArgument(int argc, char *argv[]) return 1; } else if (argc > 1 && !strcmp(argv[0], VMOPTION("dpcso"))) { extern usqIntptr_t debugPrimCallStackOffset; - debugPrimCallStackOffset = (usqIntptr_t) strtobkm(argv[1]); + debugPrimCallStackOffset = (usqIntptr_t) strtobkm(argv[1]); return 2; } + else if (!strcmp(argv[0], VMOPTION("dpcso:"))) { + extern usqIntptr_t debugPrimCallStackOffset; + debugPrimCallStackOffset = strtobkm(argv[0]+strlen(VMOPTION("dpcso:"))); + return 1; } else if (argc > 1 && !strcmp(argv[0], VMOPTION("cogmaxlits"))) { extern sqInt maxLiteralCountForCompile; maxLiteralCountForCompile = strtobkm(argv[1]); return 2; } else if (!strncmp(argv[0], VMOPTION("cogmaxlits:"), strlen(VMOPTION("cogmaxlits:")))) { extern sqInt maxLiteralCountForCompile; - maxLiteralCountForCompile = strtobkm(argv[0]+strlen(VMOPTION("cogmaxlits:"))); + maxLiteralCountForCompile = strtobkm(argv[0]+strlen(VMOPTION("cogmaxlits:"))); return 1; } else if (argc > 1 && !strcmp(argv[0], VMOPTION("cogminjumps"))) { extern sqInt minBackwardJumpCountForCompile; From ea7c302509249b578456e9f0d0d2a1ba2a074c31 Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Wed, 3 Jan 2018 16:31:56 +0100 Subject: [PATCH 6/6] Properly align Windows VM usage message --- platforms/win32/vm/sqWin32Window.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/platforms/win32/vm/sqWin32Window.c b/platforms/win32/vm/sqWin32Window.c index fa92aa3b34..72f2687f6f 100644 --- a/platforms/win32/vm/sqWin32Window.c +++ b/platforms/win32/vm/sqWin32Window.c @@ -3305,7 +3305,7 @@ int printUsage(int level) TEXT("vmOptions:") TEXT("\n\t") TEXT(VMOPTION("service:")) TEXT(" ServiceName \t(install VM as NT service)") TEXT("\n\t") TEXT(VMOPTION("headless")) TEXT(" \t\t(force VM to run headless)") - TEXT("\n\t") TEXT(VMOPTION("timephases")) TEXT(" \t(print start load and run times)") + TEXT("\n\t") TEXT(VMOPTION("timephases")) TEXT(" \t\t(print start load and run times)") TEXT("\n\t") TEXT(VMOPTION("log:")) TEXT(" LogFile \t\t(use LogFile for VM messages)") TEXT("\n\t") TEXT(VMOPTION("memory:")) TEXT(" megaByte \t(set memory to megaByte MB)") #if STACKVM || NewspeakVM @@ -3313,32 +3313,32 @@ int printUsage(int level) #endif /* STACKVM || NewspeakVM */ #if STACKVM TEXT("\n\t") TEXT(VMOPTION("breakmnu:")) TEXT(" string \t(call warning on MNU of sel for debug)") - TEXT("\n\t") TEXT(VMOPTION("leakcheck:")) TEXT(" n \t(leak check on GC (1=full,2=incr,3=both))") - TEXT("\n\t") TEXT(VMOPTION("eden:")) TEXT(" bytes \t(set eden memory size to bytes)") - TEXT("\n\t") TEXT(VMOPTION("stackpages:")) TEXT(" n \t(use n stack pages)") - TEXT("\n\t") TEXT(VMOPTION("numextsems:")) TEXT(" n \t(allow up to n external semaphores)") + TEXT("\n\t") TEXT(VMOPTION("leakcheck:")) TEXT(" n \t\t(leak check on GC (1=full,2=incr,3=both))") + TEXT("\n\t") TEXT(VMOPTION("eden:")) TEXT(" bytes \t\t(set eden memory size to bytes)") + TEXT("\n\t") TEXT(VMOPTION("stackpages:")) TEXT(" n \t\t(use n stack pages)") + TEXT("\n\t") TEXT(VMOPTION("numextsems:")) TEXT(" n \t\t(allow up to n external semaphores)") TEXT("\n\t") TEXT(VMOPTION("checkpluginwrites")) TEXT(" \t(check for writes past end of object in plugins") - TEXT("\n\t") TEXT(VMOPTION("noheartbeat")) TEXT(" \t(no heartbeat for debug)") + TEXT("\n\t") TEXT(VMOPTION("noheartbeat")) TEXT(" \t\t(no heartbeat for debug)") #endif /* STACKVM */ #if STACKVM || NewspeakVM # if COGVM - TEXT("\n\t") TEXT(VMOPTION("trace")) TEXT("[=num]\tenable tracing (optionally to a specific value)\n") + TEXT("\n\t") TEXT(VMOPTION("trace")) TEXT("[=num]\t\tenable tracing (optionally to a specific value)") # else - TEXT("\n\t") TEXT(VMOPTION("sendtrace")) TEXT(" \t(trace sends to stdout for debug)") + TEXT("\n\t") TEXT(VMOPTION("sendtrace")) TEXT(" \t\t(trace sends to stdout for debug)") # endif - TEXT("\n\t") TEXT(VMOPTION("warnpid")) TEXT(" \t(print pid in warnings)") + TEXT("\n\t") TEXT(VMOPTION("warnpid")) TEXT(" \t\t(print pid in warnings)") #endif #if COGVM TEXT("\n\t") TEXT(VMOPTION("codesize:")) TEXT(" bytes \t(set machine-code memory size to bytes)") - TEXT("\n\t") TEXT(VMOPTION("cogmaxlits:")) TEXT(" n \t(set max number of literals for methods to be compiled to machine code)") + TEXT("\n\t") TEXT(VMOPTION("cogmaxlits:")) TEXT(" n \t\t(set max number of literals for methods to be compiled to machine code)") TEXT("\n\t") TEXT(VMOPTION("cogminjumps:")) TEXT(" n \t(set min number of backward jumps for interpreted methods to be considered for compilation to machine code)") - TEXT("\n\t") TEXT(VMOPTION("tracestores")) TEXT(" \t(assert-check stores for debug)") - TEXT("\n\t") TEXT(VMOPTION("reportheadroom")) TEXT("\t(report unused stack headroom on exit)") - TEXT("\n\t") TEXT(VMOPTION("dpcso:")) TEXT(" bytes \t(stack offset for prim calls for debug)") + TEXT("\n\t") TEXT(VMOPTION("tracestores")) TEXT(" \t\t(assert-check stores for debug)") + TEXT("\n\t") TEXT(VMOPTION("reportheadroom")) TEXT(" \t(report unused stack headroom on exit)") + TEXT("\n\t") TEXT(VMOPTION("dpcso:")) TEXT(" bytes \t\t(stack offset for prim calls for debug)") #endif /* COGVM */ #if SPURVM TEXT("\n\t") TEXT(VMOPTION("maxoldspace:")) TEXT(" bytes \t(set max size of old space memory to bytes)") - TEXT("\n\t") TEXT(VMOPTION("logscavenge")) TEXT(" \t(log scavenging to scavenge.log)") + TEXT("\n\t") TEXT(VMOPTION("logscavenge")) TEXT(" \t\t(log scavenging to scavenge.log)") #endif TEXT("\n") TEXT("Options begin with single -, but -- prefix is silently accepted") TEXT("\n") TEXT("Options with arguments -opt:n are also accepted with separators -opt n")