# 7 Reference Section

This chapter gives a complete description of all the menus Ozcar provides.

## 7.1 The Main Menu

The main menu is located on the top of Ozcar's main window.

### 7.1.1 Ozcar

About...

  Pops up an info box containing author and compilation information

Destroy

  Closes the internal Ozcar object. Use this menu entry only if Ozcar hangs, as all information about currently attached threads gets lost.

Suspend | C-x

  Closes the main window, sets the mozart emulator to non debug mode, and causes the compiler to generate non debug code. Information about currently attached threads is preserved.

### 7.1.2 Action

Step Into | s

  Do exactly one step (stop again at the next step point, enter procedures). Identical to pressing the button.

Step Over | n

  Do one step, jump over procedures or other blocks which constitute a step point. Identical to pressing the button.

Unleash | c

  Continue execution until the marked stack frame is about to be removed from the stack, or until the stack is empty if no frame is marked. Identical to pressing the button.

Stop | z

  Stop the current thread at the next step point it reaches. Identical to pressing the button.

#### The Detach submenu

This menu contains some useful entries to detach one or more attached threads:

Current | d

  Detach the current thread. Identical to pressing the button.

All But Current | C-d

  Leave the current thread alone in Ozcar's thread forest. Detach all the others, let them continue to run (if they are not dead).

All | M-d

  Detach all threads, let them continue to run (if they are not dead).

All Dead | M-u

  Detach all dead threads.

#### The Terminate submenu

This menu contains some useful entries to detach and kill one or more attached threads:

Current | t

  Detach and kill the current thread. Identical to pressing the button.

All But Current | C-t

  Leave the current thread alone in Ozcar's thread forest. Detach and kill all the others.

All | M-t

  Detach and kill all threads.

### 7.1.3 Thread

Previous | Left

  Select the thread which is located above the currently selected thread in the thread view. If the current thread is the first thread in the thread view, the last thread (at the bottom) is selected.

Next | Right

  Select the thread which is located below the currently selected thread in the thread view. If the current thread is the last thread in the thread view, the first thread (at the top) is selected.

Status | C-s

  Print some useful information about the currently attached threads, for example: 2 attached threads, currently selected: 58/1 (stopped, runnable). The first part of the information is obvious. The two numbers associated with the selected thread are the thread id and the parent thread id. In parentheses, information is given if the selected thread is stopped or running, and if it is runnable, blocked or terminated.

### 7.1.4 Stack

Previous Frame | Up

  Select the previous stack frame (if it exists) of the currently selected thread. Note that the stack grows to the bottom of the window, so you will reach an older frame.

Next Frame | Down

  Select the next stack frame (if it exists) of the currently selected thread; you will reach a younger frame.

Re-Calculate | C-l

  Update the stack view. You may see special, compiler-generated stack frames then, as well as some variables (which have been bound in the meanwhile) appear with their value instead of an underscore. (There is no automatic update which forces the stack view to display a variable's value as soon as it becomes known.)

Update Env | v

  Immediately re-calculates and re-displays the environment of the selected stack frame.

Query... | e

  Opens a dialog box where (small) statements can be executed or (small) expressions can be evaluated in the context of the currently selected stack frame. If the computation needs some more time, you see a spinner turning around until the computation ends. If it does never end (for instance because of a blocking thread), use the Reset button to cancel the operation.

### 7.1.5 Options

#### The Value Printing submenu

In this menu you can determine how to display values in the stack and variable windows. There is a short form which only prints type information, and a long form which prints the actual value (up to a given print width/depth, which can be set in the Preferences dialog box, see below).

Types Only | <

  This is the default setting. You just see type information, which leads to a very compact display style.

Complete | >

  You see the actual value, using the function `Value.toVirtualString`. This display mode can be quite unhandy if the values to be printed are large tuples or records. So you should carefully adjust the print depth and print width to your needs.

Use Emacs | C-e

  If turned off there are no bars printed within Emacs, so you don't get any position information.

Env Auto Update | C-a

  If you debug threads with huge environments, it may be a good idea to turn of the auto update of the environment (re-calculation and re-display every time you make a step) in order to save time and memory. While the variables display is not up to date, it is printed in grey. You can always request the newest environment information by pressing 'v' (see above, function 'Update Env').

Preferences... | C-o

  Opens a dialog box to adjust some self explanatory options. For example you can adjust the print width/depth of values in the stack and variable windows.

## 7.2 The SubThreads Menu

This menu is located on the right side of the button bar, below the menu bar. You can select the mode how child threads of already attached threads should be treated.

Ignore

  They will not be attached at all (but can silently run of course).

Attach

  They are attached and immediately stopped.

Unleash 0

  They are attached and the command 'Unleash 0' is executed. This gives you a good feeling about the dependencies between all your threads in a concurrent application. They are already dead (if they do not block somewhere), but are still printed in the thread view.

Unleash 1

  They are attached and the command 'Unleash 1' is executed. This makes it possible to even explore the environment of every child thread just before it terminates.

## 7.3 The Queries Menu

This menu is located on the right side of the button bar, right beside the SubThreads menu. You can select the mode how a thread which is born by setting up an Emacs query is treated by Ozcar.

Ignore

  It is not attached, neither are any of its subthreads (except, of course, they run into a breakpoint).

Attach

  It is attached and immediately stopped.