Can I do a "debug build" of GNU Smalltalk?


Debug information is usually included in the build. However, usually the resulting optimized binary is very hard to debug. So you can compile without optimization by configuring with ./configure CFLAGS=-g (or otherwise passing CFLAGS=-g to make).

You can also add the --enable-checking option to configure, which adds extra assertions at the cost of performance.

After starting gdb and before starting the VM, you have to type handle SIGSEGV noprint to ignore signals generated by the generational GC machinery.

What is a relocatable install? Are GNU Smalltalk installations relocatable?


A relocatable program can be moved or copied to a different location on the filesystem. A program supports a relocatable install if a user can copy a program, installed by another user on the same machine, to his home directory, and have it work correctly.

Versions of GNU Smalltalk up to 3.0a are never relocatable. Newer versions are relocatable under special conditions only.

How do I read input from the keyboard?


You can use the special stdin file, which you can also access (if you prefer) as FileStream stdin. Like this:

   line := stdin nextLine

or if you want a number

   n := stdin nextLine asInteger

How do I convert Squeak code to GNU Smalltalk?


gst-convert can be used. It also supports rewrite rules to fix dialect incompatibilities automatically. You can write a script called, for example, gst-squeak like this one:

#! /bin/sh
# usage: gst-squeak SOURCE DEST
# Converts Squeak code to GNU Smalltalk

exec gst-convert -f squeak \
  -r'Float->FloatD' \
  -r'BlockContext->BlockClosure' \
  -r'MessageSend->DirectedMessage' \
  -r'DateAndTime->DateTime' \
  -r'TimeStamp current->DateTime now' \
  -r'TimeStamp->DateTime' \
  -r'ProtoObject->nil' \

I found a bug in GNU Smalltalk, how do I debug it/fix it?


There are comprehensive information on this in the Hacker's guide.

Syndicate content

User login