[Vm-dev] Can I use GDB with SqueakVM ?

Michael van der Gulik mikevdg at gmail.com
Sun Mar 28 22:59:54 UTC 2010

On Mon, Mar 29, 2010 at 9:10 AM, Mariano Martinez Peck
<marianopeck at gmail.com> wrote:
> On Sat, Mar 27, 2010 at 5:57 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> Hi Mario,
>>     first you want to compile with debug symbols and perhaps with no optimization.  Second it looks like you need to link with the pthreads library, not juts compile. So you can try e.g.
>> platforms/unix/configure CFLAGS="-g3 -pthread" LIBS=-lpthread
>> FWIW I routinely use gdb on Mac OS X, linux and windows to debug the Teleplace Cog vm.
> Thanks Eliot. I tried what you said, but I got another problem now. I configure the VM, with this:
> ../unix/cmake/configure --CFLAGS="-g3 -pthread" --LIBS=-lpthread
> Then I make and make install. No problems. SqueakVM works ok and I can open my images.
> The problem is with gdb. I tried this:
> ubuntu at ubuntu-desktop:~/Pharo/vm/Squeak-$ gdb squeak
> GNU gdb (GDB) 7.0-ubuntu
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i486-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> "/home/ubuntu/Pharo/vm/Squeak-": not in executable format: File format not recognized
> (gdb)
> And the same happens with gdb ./squeak or gdb /usr/local/bin/squeak  etc...
> But squeak IS executable:
> ubuntu at ubuntu-desktop:~/Pharo/vm/Squeak-$ ls -la /usr/local/bin/squeak
> -rwxr-xr-x 1 root root 1791 2010-03-28 21:57 /usr/local/bin/squeak
> So...any ideas what can be the problem ?

Try opening "squeak" in a text editor. It could be a script that
starts the real VM executable which might be elsewhere.

Also, a tip: if you're making VMs, it's better not to install them in
/usr/local until you're happy with them being stable and working. Use:

> ../unix/cmake/configure --CFLAGS="-g3 -pthread" --LIBS=-lpthread --prefix=~/Pharo/myvm (or something).
> nice make install

(I assume the configure script takes --prefix like GNU autoconf does?)

Also, if you just want to see how the interpreter works, you can run
it inside Squeak:




More information about the Vm-dev mailing list