Interactive Debugging

Event Browser
Calculating Simple Vector Expressions
Debugging on Linux with GDB

Postmortem Debugging

ZEBRA Diagnostics

Event Browser

A very simple interactive tool, the EVENT_BROWSER, can be included in the executable program. It is based on a set of ZEBRA print out routines and can be used to navigate round either the Event Data Structure or the Titles Banks to look at the contents of individual banks or the form of a data structure tree. To run it first make sure that the display is 132 columns wide and then call it from the debugger.

All commands are based on a current store and a current bank. When the browser is first called these are the Q (Event Data Structure) store and the MAST (top level bank). The following commands are available, they may be truncated so long as they remain unambiguous:-


Movement Commands

The following commands redefine the current bank. If the movement is illegal, the current bank remains unchanged.

BACKTRACK n

Starting from current bank (which must be an MCVX in Q store), backtrack to the incident MCTK and hence its MCVX for n steps. At each step print brief summary of the step.

DOWN -n

Move down following link -n (reference or structural).

UP

Move up to supporting bank.

LEFT

Move left to next horizontal bank. If already at the beginning of a linear chain, this command moves up to supporting bank.

RIGHT

Move right to next horizontal bank.

FIND name no

Search forward from the current bank along the linear chain for the given bank name and number e.g.:- FIND GEDP 201 or FIND GEDP * the second form searches for any bank number. The FIND command is most useful with the CONS memory, because all the titles banks are connected in a linear chain.

JUMP adr

Jump directly to bank at this address. When the browser first stars it prints the current value of the LMCVXC and LMCTKC links, so the JUMP command allows you to jump directly to either of these.

Display Commands

AUTODUMP

Flip AUTODUMP state. If on the browser automatically executes a DUMP command (see below) each time any command is executed. So it is possible to move through a data structure using the movement commands, dumping each automatically. On entry to the browser, AUTODUMP is ON.

DUMP

Dump the contents of current bank using DZSHOW. The number of data and link words displayed can be controlled by the WINDOW command (see below).

GEOMETRY

This command should only be issued when the current bank is an MCVX or MCTK. It is used to help debug he geometry.

STORE

This produces a DZSTOR summary of the current store showing the space used by live and dead banks, together with the status of all link areas.

SURVEY

Survey the subtree at current bank using DZSURV. For the partial data structure supported by the current bank, this lists the number of banks, names, and the memory they occupy.

WINDOW l1 l2 d1 d2

This limits the amount of output produced by the DUMP command (see above). Only links l1:l2 and data words d1:d2 are displayed. If either pair of number is 0 0 there is no limit so, to view banks in full, use:- WIND 0 0 0 0 This is the default setting when the browser is called.

Miscellaneous Commands

HELP

Gives a brief summary of these commands.

MEMORY name

Redefines the current store. the name must be either Q (event data structure) or CONS (titles banks). If switching to Q, the current bank is set to MAST, if switching to CONS, the current bank is the first bank in the linear chain of titles banks.

Warning: Some of the titles banks are very large, so, before switching to the CONS memory you are advised to switch AUTODUMP off or to use WINDOW to limit the data display.

QCM

Query Channel Mapping i.e. query the mapping between PMT tube number and electronics channel number. Issuing this command switches the program into a mode where it is expecting queries about mapping, and allows the user to examine the mapping and the channel status (the STATUS query CCC_INFO). Type HELP for a list of these commands. Type QUIT to return to the event browser.

QUIT

Returns control to the caller (normally the debugger).

SEED n1 n2 n3

Resets the random number seed in the same way as the symbolic command $starting_seed

Calculating Simple Vector Expressions

Another simple tool for calculating common vector expression can be included. It was written to help test the geometry (see also the Event Browser command GEOMETRY). The subroutine CALC_EXPRESSION has a number of entry points to calculate such things as vector dot products and magnitudes. For example, typing the following:- call calc_dist( rq(lmcvxc+3), rq(lmcvxe+3) ) will print the distance between the vertices LMCVXC and LMCVXE. The routine also stores away the last result it computed in a local variable S (or array V if the result of the calculation is a vector). It also declares:- integer i_s real v1(3) , v2(3) , v3(3) , + s1 , s2 , s3 that can be used as a work space. Hint: to move vector S to say S1 call UCOPY. Here is a complete list of entry points:-

calc_diff( vp1 , vp2 )

v = vp1 - vp2

calc_dist( vp1 , vp2 )

s = distance between vp1 and vp2

calc_dot( vp1 , vp2 )

s = dot product of vp1 and vp2

calc_mag( vp1 )

s = magnitude of vp1

calc_shift( vp1 , sp1 , vp2 )

v = vp1 + sp1 * vp2

calc_show

prints the contents of all the local variables.
Go Back to the Snoman Companion Top Page


Highest link so far: 2:-
Debugging Event Browser Calculating Simple Vector Expressions