How to make a debug build of the VM?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make a debug build of the VM?

Gabriel Hernán Barbuto
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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to make a debug build of the VM?

Mariano Martinez Peck
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 <[hidden email]> 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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to make a debug build of the VM?

Miguel Cobá
Good summary Mariano. This is really a good way to attract new souls to
the VM arena.

Until now, the VM is seen as something very hard to understand and hack.
This summary clears the way the VM is structured for the majority of
people.

Thanks

--
Miguel Cobá
http://twitter.com/MiguelCobaMtz
http://miguel.leugim.com.mx



_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to make a debug build of the VM?

Luc Fabresse
Thanks Mariano for this ML and this great overview!

#Luc


2010/12/2 Miguel Cobá <[hidden email]>
Good summary Mariano. This is really a good way to attract new souls to
the VM arena.

Until now, the VM is seen as something very hard to understand and hack.
This summary clears the way the VM is structured for the majority of
people.

Thanks

--
Miguel Cobá
http://twitter.com/MiguelCobaMtz
http://miguel.leugim.com.mx



_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to make a debug build of the VM?

Adrian Lienhard
Maybe this blog post, which I wrote some months ago, may also help. It details each single step to get a Unix VM built from source using VMMaker.

        http://adrian-lienhard.ch/blog?article=building-a-pharo-squeak-vm-from-first-principles

I wrote this primarily for myself because each time I wanted to build a new VM I run into issues because the dependencies are really not obvious if you don't know (or remember) them...

Cheers,
Adrian

On Dec 4, 2010, at 11:27 , Luc Fabresse wrote:

> Thanks Mariano for this ML and this great overview!
>
> #Luc
>
>
> 2010/12/2 Miguel Cobá <[hidden email]>
>
>> Good summary Mariano. This is really a good way to attract new souls to
>> the VM arena.
>>
>> Until now, the VM is seen as something very hard to understand and hack.
>> This summary clears the way the VM is structured for the majority of
>> people.
>>
>> Thanks
>>
>> --
>> Miguel Cobá
>> http://twitter.com/MiguelCobaMtz
>> http://miguel.leugim.com.mx
>>
>>
>>
>> _______________________________________________
>> VM-beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>>
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners