[Vm-beginners] How to make a debug build of the VM?

Mariano Martinez Peck marianopeck at gmail.com
Thu Dec 2 18:57:20 UTC 2010


Hi Gabriel. Even if you know all what I will say after, I think this is a
good way to start this mailing list. So I will let you know what I
understand. I am learning too, so let me know if I said something wrong.

The Squeak VM has two parts of code: a) one with the "platform" code (C
hand-written code) ; b) VMMaker (written in Smalltalk)

a) platform code is written when there is C code that depends on the OS,
where performance is needed, etc.
This code is in SVN in http://www.squeakvm.org/svn/squeak/trunk/platforms/

b) VMMaker is a package that it is in squeaksource which has the rest of the
VM, written in a subset of Smalltalk called SLANG, which is then translated
to C. Here you have Interpreter, ObjectMemory, etc.

So....for building a VM, you need both. However, b) is not always necessary,
since the source (C) that is generated from VMMaker is also in the SVN
(check the "src" folder in each platform folder). When you need to generate
code from VMMaker?
- when you do changes to VMMaker (Interpreter, ObjectMemory, etc)
- When you need a VERY new vm which sources has not been uploaded to svn, or
the vm is not released yet.

The biggest problem is how to map VM releases like  Squeak VM 4.2.5b1  to
svn versions and VMMaker version. I don't know how to know that and I would
appreciate to know it.
Now....since a couple of months, we started to use a Metacello
configuration called ConfigurationOfVMMaker, which let you automatically
download all you need. Here, I insisted on putting in the description of
each version, with which SVN version you should work. So if you see for
example #version13 it says in the description: "SqueakVM svn revision 2202"

Now...if you want to build the LATEST MacVM, you will fail. I spent several
hours yesterday with Esteban Lorenzano and there are still several things to
do by hand. If you are just playing with something, I recommend you to
install a working set that we know it works:

- Metacello version 1.4
- svn version: 2203
- Pharo 1.0 (there are deprecations if you run in 1.1)

Now...for the debugging, if you use XCode, and you load the project with it,
you will find that there are already pre-defined different distributions:
Development and Deployment.
So..if you choose Development and then you put build and debug, this will
compile with all the needed -g parameters, and will then run the VM with GDB
;)
So...you can put breakpoints in the c code and debug like any other c
program. In addition, if you want to put some flags in VMMaker, you will see
that Interpreter implements #print: and friends...so inside
Interpreter/ObjectMemory you can do  "self print: 'I pass here!!!'  "   and
that will be directly shown in the gdb console :)

Finally, for the work you are doing, I recommend you to use the
InterpreterSimulator of CogVM. You can simulate the loading of the image
(what you need).

Here are some useful links:

http://www.pharocasts.com/search/label/vm
http://www.adrian-lienhard.ch/blog?article=building-a-pharo-squeak-vm-from-first-principles
http://book.pharo-project.org/book/Virtual-Machine/Building/
http://squeakvm.org/index.html

Cheers

Mariano


On Thu, Dec 2, 2010 at 3:06 PM, Gabriel Hernán Barbuto
<gbarbuto at gmail.com>wrote:

> Hi
>
> I am using the OS X VM and I want to rebuild it with debug
> information. I am assuming that the version I downloaded doesn't
> contain debug information.
>
> I want to build a specific version. If I print Smalltalk vmVersion I get:
>
>  'Squeak4.1 of 17 April 2010 [latest update: #9957] Squeak VM 4.2.5b1'
>
> I am not sure how to relate this with VMMaker version and SVN revision.
>
> Thanks in advance.
>
> Gabriel
> _______________________________________________
> VM-beginners mailing list
> VM-beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-beginners/attachments/20101202/f844b2e3/attachment.htm


More information about the VM-beginners mailing list