CedarRescue.tioga
Copyright Ó 1990, 1993 by Xerox Corporation. All rights reserved.
Brent Welch, May 24, 1990 11:52 am PDT
Christian Jacobi, April 21, 1993 5:35 pm PDT
CEDAR 10.1 —
Cedar Rescue
Magic Incantations
SHIFT-SHIFT-R15    Save All Edits - cursor changes to a square block.
META-Pause      Regain control of the screen from RawViewers
Commander % SaveAllEdits
Commander % CNTL-D  Exit Commander to PCR
pcr: callall ←SaveAllEdits←P780
pcr: callall ←RawViewersRestart←P60
pcr: callall ←RunCommander←P60
X windows: Delete the X11Viewers window gives you rescue options
World Crashes - SaveAllEdits
If no process catches an error then the whole screen gets painted with a grey wash. At this point RawViewers has relenquished control over the mouse and keyboard. Typing return should give you a prompt from the underlying Commander. Alternatively, from within X11Viewers, the Commander is available in a separate window. From the commander you can save any modified viewers with:
Commander % SaveAllEdits
It is also possible to save all your edits with the special keyboard sequence:
SHIFT-SHIFT-R15  (Hold all three keys down simultaneously for 1 second).
R15 is the "3"/"PgDn" key on the keypad. The cursor changes to a  (black box) during the SaveAllEdits function call. Yet another way to save edits is via a low-level PCR command. You get to a PCR interpreter by exiting the Commander with CNTL-D:
Commander % ^D
And then you call an ugly C function from the PCR interpreter:
pcr: callall ←SaveAllEdits←P780
You can restart the commander from PCR with:
pcr: callall ←RunCommander←P60
Viewer Wedges
During a "Viewers Wedge" the mouse may track, but buttons, scroll bars, etc. are unresponsive. At this point, SHIFTSHIFT←R15 may or may not work to save edits. You can, however, regain control of the screen with the special keyboard sequence:
META-Pause  (Hold both keys down simultaneously for 1 second.)
META is the key labeled with a diamond (.#`H¢è®©Hfèf¬#®#°‡Céf°#è¬#°]Òf° (Sun 4/110). Pause is R1 on the keypad. You should be able to hit return and get a prompt from the Commander underlying RawViewers. From X11Viewers this key sequence has no effect; use the Commander in the CedarShell window. If META-Pause doesn't work, you can rlogin to your workstation and use:
<unix> % kbd←mode -a
This resets the keyboard and you can try to get to the underlying Commander.
Handling Uncaught Errors with the Commander
By default, the Commander catches uncaught errors for threads it has started up.
In this case, the Commander will prompt you with:
*** Uncaught Error: {error type} *** Do you want to debug this ? [y, n, s]:
"s" will give a short stack backtrace. You can add backtrace args after the "s" (i.e., -allFrames).
"y" will propagate the error to the resident debugger (i.e., Cirio). If no debugger
 exists your world will die with a "grey wash", but see above for rescue steps.
"n" will ignore the error and abort the thread.
Handling Uncaught Errors with Cirio
If Cirio has already been loaded then the Commander will let it catch uncaught errors. In this case Cirio will pop up a window and the Commander won't prompt you. You can also start up Cirio after the Commander has caught an error. Use another Commander viewer to:
Commander % CirioLocal
and then respond "y" to the Commander's error prompt. This passes the error along to Cirio.
Openr CirioDoc.tioga will give you a complete description of Cirio. However, commonly one clicks on the "Summary" button to get a stack trace. You can examine a particular frame by selecting the frame number and SHIFT-middle clicking "WalkStack".
Debugging World Crashes
There are two ways to debug your crashed world. One is to start up another Cedar world and use Cirio. You have to point Cirio at the right host if the world is on a different workstation.
Commander % CirioRemote <hostname>
Inside Cirio, click "StopRemoteWorld" and then "CallingDebugger" or "All" to list threads.
Click "Quick" on a thread to get its stacktrace. Click "Prcd" to continue past a breakpoint.

Alternatively, you can use RemoteDebugTool, a Unix program.
<unix> % /pseudo/xrhome/3𡤀.X/BIN/OptThreads-sparc/RemoteDebugTool
Note that there are actually many instances of RemoteDebugTool. The above example refers to the PCR 3.0 version compiled with optimization. This must match the PCR that you are using inside your world. Someone should create a script that lives in a normal comand directoy (i.e. /usr/local/bin) and runs RemoteDebugTool for the INSTALLED version of PCR. Connect to your world from RemoteDebugTool and then you can look around:
(rdt): connect <host>
(rdt): stop   prints out the threads with a * by the one calling the debugger.
(rdt): help   lists available RemoteDebugTool comands
 (rdt): abort <n> nukes thread <n>
(rdt): quit   exits RemoteDebugTool and continues or kills the Cedar world (it asks).
X11Viewers menu options
Exiting Cedar with a window manager exit will start a dialogue by showing a pup up menu.
The pop up menu lets you find enties like
Save all edits   does the obvious...
Assert keys up   usefull if selection is confused
Give up Cedar and X focus usefull if input focus is confused
Destroy connection   usefull if X window connection is confused