Feeds:
Posts
Comments

Method Category browsing

I want this for some Help documentation in CMakeVMMakerSqueak so I can show the end user all the methods in a specific method category.

 

Here is a quick example showing all the methods in the Class CompiledMethod under method category ‘accessing-pragmas & properties’:

 

Browser openBrowserView:((Browser new)
selectSystemCategory: #’Kernel-Methods’;
selectClass: CompiledMethod;
metaClassIndicated: false;
selectMessageCategoryNamed: #’accessing-pragmas & properties’;
selectMessageNamed: nil;
openMessageCatEditString:nil)
label: ‘Message Category Browser (‘, #’Kernel-Classes’ asString, ‘)’.

You can get that view by right-clicking on the method category name and selecting ‘browse’.

I think a wrapper class for this would be useful.

 

 

 

 

Here are the command line commands I used to get CogSpur running with a VMMaker image and the CMakeVMakerSqueak package starting from scratch.

#Do an svn checkout

svn co http://www.squeakvm.org/svn/squeak/branches/Cog

#run Eliot’s bash script to get the VMMaker image up and configured.

cd Cog/image
cat README
./ buildspurtrunkvmmakerimage.sh
./ cogspurlinuxht/squeak  SpurVMMaker.image  &

#Install the CMakeVMMakerSqueak package and see the documentation
Monticello browser
Repository http://source.squeak.org/VMMaker
CMakeVMMaker (latest) load
CMakeVMMakerSqueak (latest) load
HelpBrowser topic CMakeVMMakerSqueak

save and quit

#set up my personal working environment

#put the executable cog/spur in my PATH

mv cogspurlinuxht /home/tty/usr/bin/

#set up a development area independent of the Cog svn source tree
cd ../../
mkdir cogspurVMMaker
mv Cog/image/SpurVMMaker.* cogspurVMMaker/
mv Cog/image/SqueakV50.sources cogspurVMMaker/

#the tools are installed. now we need to put the Cog source tree
#in a subdirectory of the .image file. The directory is named ‘oscogvm’

cd cogspurVMMaker
mkdir oscogvm
rsync -Carv  –exclude=”image*”  ../Cog/ cogspurVMMaker/

#the resulting work environment directory tree looks like this

tree -d -L 2  cogspurVMMaker/
cogspurVMMaker/
`– oscogvm
|– build.linux32ARM
|– build.linux32x86
|– build.linux64x64
|– build.macos32x86
|– build.macos64x64
|– build.win32x86
|– history
|– nsspursrc
|– nsspurstack64src
|– nsspurstacksrc
|– nssrc
|– platforms
|– processors
|– products
|– scripts
|– sources
|– spur64src
|– spursistasrc
|– spursrc
|– spurstack64src
|– spurstacksrc
|– src
`– stacksrc

 

This is a quick note as I get up to speed on the project after a long hiatus. Ben at the mailing list asked for help on getting set up. Here is one of the scripts to install the tools:

 

| manifest load |
Scanner prefAllowUnderscoreSelectors: true.

manifest := #(    (‘http://source.squeak.org/FFI’                    1    (‘FFI-Pools’ ‘FFI-Kernel’))
(‘http://source.squeak.org/VMMaker’        6    (‘Balloon-Engine-Pools’ ‘VMMaker.oscog’ ‘Cog’ ‘CogTools’ ‘ImageFormat’ ‘CMakeVMMaker’ ‘CMakeVMMakerSqueak’))
(‘http://ss3.gemstone.com/ss/MethodMassage’        3    (‘MethodMassage’ ‘MethodMassageCompatibility’))
(‘http://www.squeaksource.com/AioPlugin’        7    (‘VMConstruction-Plugins-AioPlugin’))
(‘http://www.squeaksource.com/Alien’            0    (‘Alien’))
“(‘http://www.squeaksource.com/FreeTypePlus’    5    (‘FreeType’)) can’t load this.  it is toxic to Squeak 4.5”
(‘http://ss3.gemstone.com/ss/FreeTypePlus’    5    (‘FreeTypeConstants’ ‘FreeType’ ‘FreeTypeTests’))
(‘http://www.squeaksource.com/FreetypePlugin’    8    (‘Freetype-Plugin’))
(‘http://www.squeaksource.com/OSProcess’        4    (‘OSProcess’))
(‘http://www.squeaksource.com/OSProcessPlugin’    9    (‘VMConstruction-Plugins-OSProcessPlugin.oscog’))
(‘http://www.squeaksource.com/rb’                5    (‘AST-Core’ ‘AST-Semantic’ ‘AST-Tests-Core’ ‘AST-Tests-Semantic’ ‘Refactoring-Changes’ ‘Refactoring-Core’ ‘Refactoring-Environment’ ‘Refactoring-Tests-Changes’ ‘Refactoring-Tests-Core’ ‘Refactoring-Tests-Environment’))
(‘http://www.squeaksource.com/Speech’            2    (‘SharedPool-Speech’ ))).

load := (manifest collect:
[:tuple|
[:path :order :packages| | repository |
repository := MCHttpRepository
location: path
user: ‘squeak’
password: ‘squeak’.
MCRepositoryGroup default addRepository: repository.
{repository. order. packages}] valueWithArguments: tuple])
sort: [:a :b| a second <= b second].

#(    ‘FT2Constants.st’
‘Object-performwithwithwithwithwith.st’
‘CompiledMethod-usesAlternateBytecodeSet.st’
‘FileDirectory-on-methods.st’
) do:
[:fileName| (FileDirectory default fileNamed: fileName) fileIn].

World findATranscript: nil.

load do:
[:tuple|
[:repository :order :packages|
packages do:
[:package| | latestVersion |
latestVersion := (repository versionNamesForPackageNamed: package) first.
[| version |
version := ((MCCacheRepository default includesVersionNamed: latestVersion)
ifTrue: [MCCacheRepository default]
ifFalse: [repository]) versionNamed: latestVersion.
version load.
version workingCopy repositoryGroup addRepository: repository]
on: Warning
do: [:ex|
(ex messageText beginsWith: ‘This package depends on the following classes’) ifFalse:
[ex pass].
ex resume]]]
valueWithArguments: tuple].

For those folks getting the pthread_setschedparam the example Eliot gives at http://www.mirandabanda.org/files/Cog/VM/VM.r3006/README.3006 does not apply to Slackware linux and I suspect other distros too.

I did some digging this morning and figured out how to set this up on my system.

This site https://www.hackthissite.org/articles/read/932 gives an overview, but it is a bit outdated.

On Slackware 14.1 the output of ‘man limits’ shows a few more entries

· A: max address space (KB)

· C: max core file size (KB)

· D: max data size (KB)

· F: maximum filesize (KB)

· K: file creation mask, set by umask(2).

· I: max nice value (0..39 which translates to 20..-19)

· L: max number of logins for this user

· M: max locked-in-memory address space (KB)

· N: max number of open files

· O: max real time priority

· P: process priority, set by setpriority(2).

· R: max resident set size (KB)

· S: max stack size (KB)

· T: max CPU time (MIN)

· U: max number of processes

I created the /etc/limits file and added an entry

tty O100

logout out and back in and I was able to run the squeak.cog.v3 build just fine.
Prior to that limit fix, I was getting the dreaded pthread_setschedparam error and could only run the vm as root.

Hope that helps.

I think I have the solution to autoconf not expanding the NoDbgRegParms on my version of the autotools in build.linux32x86/squeak.cog.v3

SHORT VERSION:
in Cog/platforms/unix/config/config.h.in add the line

#define NoDbgRegParms

in the header files Cog/src/vm/config/
cogit.h
cointerp.h
cointerpmt.h

remove the following construct

#if !defined(NoDbgRegParms)
# define NoDbgRegParms /*empty*/
#endif

Reasoning: In the configure template we define the darn thing as an empty sting by default and only set it to something when we intend to use it for debugging.

LONG VERSION:

Tools versions are:
autoconf (GNU Autoconf) 2.69
gcc (GCC) 4.8.2

in Cog/platforms/unix/config/config.h.in add the line

#define NoDbgRegParms

in Cog/src/vm/config/
cogit.h
cointerp.h
cointerpmt.h

remove the following construct

#if !defined(NoDbgRegParms)
# define NoDbgRegParms /*empty*/
#endif

Shut-down the machine. Unplug it. Wait a bit. Plug it back in and boot.

Symptoms where none of my usb devices would show up with lsusb or lsscsi.
My usb mouse did not work.

dmesg had errors like:

usb 9 – 4 device not accepting address 8, -error -32
usb 9 – 4 device not accepting address 9, -error -32
hub 9-0:1.0 unable to enumerate usb device on port 4

A google on the above finally yielded the fix.

I posted this to vm-dev. I repeat it here as it is easier for me to find it when I need to review (:

Hi All.

I am tackling the “cmake must generate config.h” problem now. In doing so, I had to study Ian’s code to see how he did it and this is what I learned.*

In Ian’s CMake code (svn co http://squeakvm.org/svn/squeak/trunk), the overview I see is as follows.

platforms/unix/cmake/configure script collects some shell variables and invokes cmake with some arguments collected from the shell script.
This runs cmake which uses the platforms/unix/CMakeLists.txt file as its commands.
The structure of this file is (broadly)
1 outer global structure/variables.
2. INCLUDE (in place substitution) of platforms/unix/vm/build.cmake Which is basically what is done in the current CMakeVMMaker
3. INCLUDE (in place substitution) of platforms/unix/vm/config.cmake. This handles testing the system and generating the config.h files on *nix.
4. other stuff (packaging and stuff I glossed over)
There are ancilliary files used for testing and Macros, but that is the overall structure.

Now, the encouraging part is that I am porting 3 above into the CMakeVMMaker(Squeak) stuff and it is going through the config routine and giving me output (:

……..
— Check size of void *
— Check size of void * – done
CMake Error: The source directory “CMAKE_BINARY_DIR/CMakeFiles/CMakeTmp” does not exist.
Specify –help for usage, or press the help button on the CMake GUI.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error: The source directory “CMAKE_BINARY_DIR/CMakeFiles/CMakeTmp” does not exist.
Specify –help for usage, or press the help button on the CMake GUI.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
— Looking for alloca.h
— Looking for alloca.h – found
— Looking for sys/time.h
— Looking for sys/time.h – found
— Looking for sys/filio.h
— Looking for sys/filio.h – not found
— Looking for nanosleep
— Looking for nanosleep – found
— Looking for iconv.h
— Looking for iconv.h – found
— Looking for langinfo.h
— Looking for langinfo.h – found
CMake Error at config.cmake:147 (TRY_COMPILE):
try_compile unknown error.
Call Stack (most recent call first):
CMakeLists.txt:88 (include)

— Looking for libiconv_open in iconv
— Looking for libiconv_open in iconv – not found
— Looking for dlfcn.h
— Looking for dlfcn.h – found
— Looking for dlopen in dl
— Looking for dlopen in dl – found
— Looking for _dyld_present
— Looking for _dyld_present – not found
— Looking for snprintf
— Looking for snprintf – found
— Looking for __snprintf
— Looking for __snprintf – not found
— Looking for tzset
— Looking for tzset – found
— Looking for timezone
— Looking for timezone – found
— Performing Test HAVE_TM_GMTOFF
— Performing Test HAVE_TM_GMTOFF – Success
— Looking for mmap
— Looking for mmap – found
— Configuring incomplete, errors occurred!

Which is good. I will be getting this cleaned and ported, but the gist is it is looking good for the requirements.

Then comes modifying the plugin generation such that each plugin contributes its own config.h (this is what Ian’s code does. you do a find for cmake.config in the trunk directory and you will see the individual config inputs for the plugins)

Its getting close. If this goes well, I should have something releasable/repeatable and documented for people to poke around in next week.

Follow

Get every new post delivered to your Inbox.