The emacs mode also permits selectively hiding and displaying various
levels of a Sather file (i.e. you can hide all routine bodies or entire
class bodies, displaying only the name).
The Sather Browser
The Sather browser (bs) is written in a combination of Tcl/Tk
and Sather. It builds on the compiler and is a part of the standard
Sather distribution. Using the browser you can view the type graph of
a particular program and the features of various classes used in the
program. The type graph and other program data can be viewed in
various selective ways so as to focus on the relevant information in
Even at run-time, a Sather program cannot "crash" (provided all checks are turned on), and this helps enormously in localizing bugs. The most common sources of errors are void and assertion checks. When the program is compiled with -debug, it will print out a stack trace when an assertion is violated. This stack trace is usually sufficient to eliminate the bug. For more complex bugs, you can use gdb, which can be automatically invoked when an assertion fails.
The ICSI Sather compiler generates portable C which can be annotated in various ways to make debugging easier with the standard C debugging tools such as gdb.
The main problem with using gdb is dealing with the name mangling. The compiler has an option, -pretty, that annotates the generated C code to indicate the unmangled Sather names. A more powerful compiler option, -debug, causes Sather line numbers to be used, and a set of debugging functions to be compiled in. These functions can print out the structure of Sather objects using the Sather names of those objects. With the ability to set breakpoints in the Sather source, and to view objects, you get much of the functionality you would have with native gdb support.
If you compile your program with the option -debug_graphical, you can graphically browse data-structures in the program using a point and click Tk based user interface. The interaction with gdb is somewhat clumsy, but independance from gdb permits us to avoid tracking gdb updates.
|Last change: 6/04/96||The Sather Team (firstname.lastname@example.org)|