Skip to content

Commit

Permalink
Merge pull request #231 from zecke/fix-trace-for-pharo
Browse files Browse the repository at this point in the history
macos: Fix --trace for the PharoVM
  • Loading branch information
nicolas-cellier-aka-nice committed Apr 2, 2018
2 parents 4c4686e + ccde31c commit 1614d95
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions platforms/iOS/vm/OSX/sqSqueakOSXApplication.m
Expand Up @@ -65,9 +65,11 @@ Some of this code was funded via a grant from the European Smalltalk User Group
#ifdef PharoVM
# define VMOPTION(arg) "--"arg
# define VMOPTIONOBJ(arg) @"--"arg
# define VMOPTIONLEN(n) (1+n)
#else
# define VMOPTION(arg) "-"arg
# define VMOPTIONOBJ(arg) @"-"arg
# define VMOPTIONLEN(n) (n)
#endif

usqInt gMaxHeapSize = 512*1024*1024;
Expand Down Expand Up @@ -222,19 +224,19 @@ - (int) parseArgument: (NSString *) argData peek: (char *) peek
return 1;
}
#if COGVM
if ([argData compare: VMOPTIONOBJ("trace") options: NSLiteralSearch range: NSMakeRange(0,6)] == NSOrderedSame) {
if ([argData compare: VMOPTIONOBJ("trace") options: NSLiteralSearch range: NSMakeRange(0,VMOPTIONLEN(6))] == NSOrderedSame) {
extern int traceFlags;

if ([argData length] == 6) {
if ([argData length] == VMOPTIONLEN(6)) {
traceFlags = 1;
return 1;
}
if ([argData length] <= 7
|| [argData characterAtIndex: 6] != '='
|| !isdigit([argData characterAtIndex: 7]))
if ([argData length] <= VMOPTIONLEN(7)
|| [argData characterAtIndex: VMOPTIONLEN(6)] != '='
|| !isdigit([argData characterAtIndex: VMOPTIONLEN(7)]))
return 0;

traceFlags = atoi([argData UTF8String] + 7);
traceFlags = atoi([argData UTF8String] + VMOPTIONLEN(7));
return 1;
}
if ([argData isEqualToString: VMOPTIONOBJ("tracestores")]) {
Expand Down

0 comments on commit 1614d95

Please sign in to comment.