Getting Started: GNU Emacs Integration (cont'd)


  This section describes a few remaining commands that did not fit into the previous sections.

Examining the stack etc.

It is possible to print the current execution stack with:

stack

and to print only the topmost element on the stack with:

topofstack

The topmost element on the stack is the "current" object, and one particular part of this object is the "current object slice", containing the state and executing the dopart from one particular "MainPart" (a piece of syntax enclosed by "(#" and "#)" parentheses). The current object slice can be printed with the command:

currentslice

The outermost object in the nesting structure contains everything in a BETA (and gbeta) program execution, and this object can be printed using the command:

primaryobject

The primary object is the only part of the state which can be inspected in the "terminated>" state.

Killing threads

When executing a concurrent program, it may be convenient to be able to kill the current thread, and this is done with:

kill

If a given thread is not the active one when the prompt is printed, there is no way to browse the set of threads and discover what identity number a given thread has, and then kill it. (This may be fixed later, though.) A special variant of the command:

kill all

will kill all threads, just like repeating kill enough times, hence making it possible to restart the execution of the program immediately.

Name applications and declarations

It is often necessary to look up the declaration associated with a given application (i.e. non-declaring occurrence) of the name. Since the scope rules are complicated in a language with inheritance, and BETA has especially rich scope rules because of the combination of general nesting and inheritance, and since gbeta makes the whole thing even more complicated by adding multiple inheritance and also inheritance from virtual patterns (whose static type depends on the position of the application), since all that (and even without it :-), it is very important to have tool support for interactive name lookups.

In gbeta, interactive name lookup is supported by means of the declaration command, like:

decl 705

.. but since a character position argument is awkward (who knows the exact character position of a piece of source code when looking at it?) this kind of invocation is seldom used. Double-clicking on the name application, on the other hand,

[ click-click! ]

does exactly the same thing, and this brings forward the source code containing the declaration, even if it is in another file than the application.

Please note that this is real name lookup, and it will not confuse two name declarations even if the declared names are spelled identically, nor will it find a name mentioned in the middle of a comment. It uses the information from static analysis which is created and kept by the interpreter anyway.

This ends the description of the practical usage of gbeta.

 


Signed by: eernst@cs.auc.dk. Last Modified: 3-Jul-01