[Vm-dev] [commit][2667] minor improvements to VM error logging at
startup
commits at squeakvm.org
commits at squeakvm.org
Thu Jan 10 00:38:16 UTC 2013
Revision: 2667
Author: rowledge
Date: 2013-01-09 16:38:16 -0800 (Wed, 09 Jan 2013)
Log Message:
-----------
minor improvements to VM error logging at startup
Modified Paths:
--------------
trunk/platforms/RiscOS/vm/sqRPCMain.c
Modified: trunk/platforms/RiscOS/vm/sqRPCMain.c
===================================================================
--- trunk/platforms/RiscOS/vm/sqRPCMain.c 2013-01-10 00:06:46 UTC (rev 2666)
+++ trunk/platforms/RiscOS/vm/sqRPCMain.c 2013-01-10 00:38:16 UTC (rev 2667)
@@ -93,12 +93,12 @@
/* No Report: so try an ordinary log file */
#define LogName "Squeak/vmlog\0"
char *logPath;
- logPath = (char*)malloc(strlen(vmPath) + strlen(LogName));
+ logPath = (char*)malloc(strlen(vmPath) + strlen(LogName) + 2);
if (logPath == NULL) {
logfile = (FILE *)-1;
return 0;
}
- sprintf(logPath, "%s%s", vmPath, LogName);
+ sprintf(logPath, "%s^.%s", vmPath, LogName);
logfile= fopen(logPath, "a+");
free(logPath);
}
@@ -702,7 +702,10 @@
dummyWimpPoll();
- /* read the image file and allocate memory for Squeak heap */
+ /* read the image file and allocate memory for Squeak heap
+ - the image name has been set to the path parsed by c.sqArgument
+ - if no filename was passed in, the default is to expect an image
+ file (Squeak/image) inside the application directory */
f = fopen(imageName, "rb");
PRINTF(("\\t Starting Squeak with image file: %s\n", imageName));
if (f == NULL) {
@@ -710,7 +713,8 @@
extern char VMVersion[];
privateErr.errnum = (bits)0;
sprintf(privateErr.errmess, "Could not open the Squeak image file '%s' (Squeak version: %s)", imageName, VMVersion);
- printf("%s\n", privateErr.errmess);
+ printf("Squeak version: %s was unable to find and open the image file supposedly at %s\n", VMVersion, imageName);
+ printf("If you simply tried to run the !Squeak application, it will have attempted to run a default image within the application directory which is not usually present\n");
platReportError((os_error *)&privateErr);
helpMessage(vmPath, "!ImName");
ioExit();
More information about the Vm-dev
mailing list