[Vm-dev] VM Maker: CogTools-eem.76.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Oct 6 19:02:54 UTC 2016

Eliot Miranda uploaded a new version of CogTools to project VM Maker:

==================== Summary ====================

Name: CogTools-eem.76
Author: eem
Time: 6 October 2016, 12:02:39.643678 pm
UUID: 7a99d08b-be74-4b9d-b251-c92799b15e2a
Ancestors: CogTools-eem.75

On Mac OS X, don't use the -f option to nm; it is misinterpeeted on El Capitain to mean "-format".

=============== Diff against CogTools-eem.75 ===============

Item was changed:
  ----- Method: VMProfilerMacSymbolsManager>>parseSymbolsFor: (in category 'parsing') -----
  parseSymbolsFor: module
  	| arch proc symtab symStream |
- 	arch := (Smalltalk image getSystemAttribute: 1003) caseOf: {
- 				['intel']	->	['i386'].
- 				['x64']	->	['x86_64'].
- 				}.
  	(tempDir fileExists: module shortName) ifFalse:
+ 		[arch := (Smalltalk image getSystemAttribute: 1003) caseOf: {
+ 					['intel']	->	['i386'].
+ 					['x64']	->	['x86_64'] }.
+ 		 "N.B. Don't use the -f option (which meant flat symbols) as in El Capitan it is misinterpreted to mean -format."
+ 		 proc := OSProcess thisOSProcess command:
- 		[proc := OSProcess thisOSProcess command:
  						'cd ', tempDir fullName,
+ 						';nm -n -arch ', arch, " -f" ' "', module name, '" | grep -v " [aAU] " >"', module shortName, '"'].
- 						';nm -n -arch ', arch, ' -f "', module name, '" | grep -v " [aAU] " >"', module shortName, '"'].
  	symStream := (Array new: 1000) writeStream.
  	symStream nextPut: module.
  	proc ifNotNil:
  		[[proc isComplete] whileFalse: [(Delay forMilliseconds: 25) wait]].
  	symtab := [StandardFileStream readOnlyFileNamed: (tempDir fullNameFor: module shortName)]
  					on: Error
  					do: [:ex| "Handle flaky OSProcess stuff by reporting error and failing to parse"
  						Transcript print: ex; flush.
  	module shortName = 'HIToolbox' ifTrue: [self halt].
  	[| prev |
  	 prev := self parseSymbolsFrom: symtab to: symStream.
  	"CoreAUC has a huge chunk of data at the end of its text segment that causes the profiler to spend ages
  	 counting zeros.  Hack fix by setting the end of the last symbol in the text segment to a little less than 1Mb." 
  	"00000000000f1922    retq" "Mavericks 13.4"
  	"00000000000f3b21    retq" "Yosemite 14.5"
  	module shortName = 'CoreAUC' ifTrue: [prev limit: 16rf8000].
  		at: module
  		put: (self relocateSymbols: symStream contents allButFirst inModule: module).
  	 (prev notNil
  	  and: [prev limit isNil]) ifTrue: [prev limit: module limit]]
  		ensure: [symtab close]!

More information about the Vm-dev mailing list