Copyright c Xerox Corporation 1980Inter-Office MemorandumToMesa UsersDateOctober 27, 1980FromBruce Malasky, John WickLocationPalo AltoSubjectMesa 6.0 Debugger UpdateOrganizationSDD/SS/MesaXEROX Filed on: [Iris]Doc>Debugger60.bravo (and .press)This memo outlines changes made in the Mesa Debugger since the last release (Mesa 5.0, April 9,1979); it is intended as a concise guide to conversion, not a detailed specification of the changes.Complete documentation on the Mesa 6.0 Debugger can be found in the Mesa DebuggerDocumentation.User InterfaceThe Debugger's user interface incorporates changes made in Tajo (the Tools Environment); thewindow package Wisk has been converted to use Vista, the new window package. For morecomplete documentation on the Tajo design, see the Tajo User's Guide and the Tajo FunctionalSpecification.TypeinThe assignment of some function keys and mouse buttons has changed. The menu button is nowYELLOW (formerly BLUE). FL4 is no longer the stuff key; use FR4 (Spare2), Keyset2, or ^S. Thefollowing function keys are implemented (see the section on editing for an explanation of thefunctions):FunctionADL KeyboardMicroswitch KeyboardKeysetControl KeyCutDELDELKeyset5^CPasteLFLFKeyset1^FNextFL3(none)Keyset3^NReplaceFL4(none)Keyset4^RSwatFR1Spare3(none)(none)StuffFR4Spare2Keyset2^SBack WordBWSpare1(none)^WReplace/NextFR5(none)(none)^KTypein is directed to the Debugger if the cursor is not in any window. Source windows will acceptinput until a file is loaded; they then direct typein to the Debugger (unless they are editable; seebelow).!pX qp]g~ri cs]pX -s7Bp ]s]p-s7Bp Ys]t(-s 7Bp Sup MsF7 Gbp&9 E7- D  .v Bl p >Jt :p2* 9Twpwp# 7"vpv 6 p 2v /hpW -sp spsp!spspspsp ,0- *r &_'# & s'# 'p& '#7& '#>`&'#B&u'#$xs+s7sAp#xs+s7sAp!Yxs+p7sApxs+p7sAp xs+s7pAppcxs+s7sApxs+s7pApsx s+p7Aps p:( <( w2>d tMesa 6.0 Debugger Update2SelectionsThe selection scheme has changed. Clicking RED once selects a character, clicking twice selects aword, three times a line, etc. The selection can be extended to the left or right with BLUE; acharacter selection is extended by characters, a word selection by words, and so on. The currentselection is now video reversed.ScrollbarsScrollbars no longer occupy a dedicated part of the window, but instead come up on top of the leftedge. They are twice as wide as before, and you can "see through" them. To obtain a scroll bar,move left just past the edge of the window, then move right slightly, back into the window.Name StripeThe name stripe and tiny windows now video reverse when the cursor is in the sections thatfunction as accelerators for the window manager menu commands (Move, Grow, Size, Top,Bottom, and Zoom).MenusExcept for the change from BLUE to YELLOW, the way menus are invoked has not changed.However, some new menus and commands have been added.Standard MenusIn addition to Move, Grow, Size, Top, Bottom, and Zoom, the standard window manager menunow also includes the following command:DeactivateThis command deactivates the selected window; it will no longer appear on the screen andthe resources used by it will be freed. The window's name is added to a menu ofdeactivated windows, which is available outside all windows. The window may be madeactive again by selecting its menu item.A new Text Ops menu is now supplied with the Debug.log and source windows in addition to theWindow Manager menu. It contains Find, Position, Split, Normalize Insertion,Normalize Selection, and Wrap; the following commands are new:SplitThe Debugger's wisk window has been replaced by the more general Split windowcommand. Feedback is similar to that in Laurel: the split line can be picked up using REDand moved vertically. The subwindow is destroyed by moving the split line off the top orbottom of the (sub)window.Normalize InsertionFor windows containing an insert point (Debug.log and editable source windows), thiscommand will position the text in the (sub)window so that the line containing the insertpoint is at the top. ftG bv ^p" sp3 ](9sp [U Y Vv SX+Mesa 6.0 Debugger Update3Normalize SelectionThis command positions the text in the (sub)window so that the line containing the leftmost position of the current selection is at the top.Debugger MenuA separate Debugger menu no longer exists; the Alter Bitmap function has been deleted, MoveBoundary has been superseded by Split (see above), and Stuff It is now available only on thekeyboard.Source MenusIn addition to the standard menus, the source window has two additional menus, Source Ops andFile Ops. The Source Ops menu contains the following commands, which are unchanged: Create,Destroy, SetBreak, SetTrace, and ClearBreak; the last three commands are available onlyif a file has been loaded into the window. The Source Ops menu contains the following newcommand:AttachCauses the Debugger to ignore the creation date of the current source file when settingbreakpoints or positioning to a source line. This command is essentially a LOOPHOLE;because the source-object correspondence may not be correct, it should be used with caution.If, after using Attach, the Debugger sets breakpoints in strange places, chances are thatthe source file does not match the version of the object in the system you are debugging.The File Ops menu includes the following new commands (plus Load, which functions as before):EditEnables editing of the currently loaded read only file (see below). Empty windows arealways editable, but because they have no backing store (until they are Saved or Storedon a file), the amount of information in the window should be kept small.SaveOutputs the contents of the window to its current file; overwriting the file requiresconfirmation. A backup "$" file is created that is a copy of the unedited version. After theSave command completes, access reverts to read only.StoreOutputs the contents of the window to the file named by the current selection; if the filealready exists, overwriting it requires confirmation. After the Store command completes,access reverts to read only.ResetDiscards all edits that have been made to the window (during this session) and resets accessto read only. If the file is not editable, the window is made empty.The Edit command is available only if a file has been associated with the window (by a previousLoad, Store, or Save); Store and Save apply only if the window has been edited. ftGbx_pA]5 Zv W^p vpx p x Upxpxp T Pv Mrp&)v p Kvpv p appears in the Debug.log if you tryto Kill or Quit from the Debugger while editing a file.Caution: The editing facilities are designed not to alter the original file until it is Saved orStored, much like Bravo; the original contents are copied to a file with "$" appended to its name.This is however, a new facility and should be used with caution. It is designed to support amoderate number of localized changes to programs, not to replace your favorite document creationsystem.Debugger CommandsChanges in Debugger commands are relatively minor. The Debugger's interpreter is more generallyavailable and more consistent with the language. Tracepoints have been re-implemented as a minorextension of the standard breakpoint facilities.Old CommandsAscii/Octal ReadThe Ascii and Octal Read commands no longer automatically increment the default valueproduced by ESC.Break/Trace PointsBreak and trace points can no longer be set by typing a source line, and the Break Module andBreak Procedure commands and corresponding Trace and Clear commands have beendeleted; the menu commands must be used.The distinction between trace and breakpoints has been removed. An optional command string cannow be attached to each breakpoint which will be executed when the breakpoint is taken. Atracepoint then becomes a breakpoint with a standard default command string. LIst Breaks listsboth break and tracepoints (List Traces has been deleted). Clear All Entries/Xits clearsboth break and tracepoints. ftG bv ^p\ ](&: [@# Yspsp9Usp##TQsyp!P spMsyp/spKasypIGbsyp3 C@ xpxp Axpxp( =vtpPxp ;xpF :'@ 85+ 6 2t /hpQ -a ,0 (v %|x #pxpx p+ !Y sp  x p.x p xpxpxp A( @ H w$)x p xpxp ) P >Y)=Mesa 6.0 Debugger Update5Tracepoints automatically invoke the normal Display Stack command processor (withsubcommand p(arameters), v(ariables), or r(esults) as appropriate). The q(uit)subcommand (not b(reak)) exits to the Debugger's command level, where the normal Proceedcommand continues execution of the client.The method of specifying conditional break and tracepoints has changed; see the ATtachCondition command in the next section.When an exit break is set, the Debugger breaks on any return of the procedure by setting the actualbreakpoint on a common return instruction. The Debugger has no way of telling which return wastaken if there is more than one. When asked to display the source line when at an exit break, theDebugger now shows the declaration line of the procedure instead of the last return statement.Case On/OffThe Debugger no longer ignores case, and the case commands have been deleted; identifiers must betyped with their correct capitalization.Control DELTyping ^DEL will now abort the display of long arrays and strings, as well as most searches. Thiskey combination no longer has to be held down to be recognized.COremapThis command now prints more information about some data segments; the (system-assigned) typescurrently recognized are heap, system, frame, table, bitmap, stream buffer, and Pup buffer.Unrecognized types (assigned by the user) are displayed as data(t); an unknown type is displayedas data(?).Display Process [process]The subcommand space (SP) can now be used to invoke the interpreter.Display StackThe new subcommand "g" displays the global variables of the module containing the currentprocedure. A space (SP) invokes the interpreter. If the source window is loaded with thes(ource) subcommand, the window will remember the appropriate context for settingbreakpoints.Interpret CallThe Interpret Call command has been deleted; the Debugger's interpreter should be used.There are no longer any restrictions on when the interpreter may be called.ReSet Context [confirm]This command now requires two keystrokes, to avoid conflict with the ReMote debuggeecommand (not yet implemented on the Alto). STart [address] [Confirm]This command now requires confirmation. ftG bpH$Ix p `v xpxpxpx ^pxp(x ](p* ZK x Yp V<' TP S<^ Q'7 NFx Kp:v J#( Fx DZpzpR B? ?dx UMesa 6.0 Debugger Update6New CommandsAScii Display [address, count]Interprets address as POINTER TO PACKED ARRAY OF CHARACTER and displays count characters (eachcharacter separately, not as a string).ATtach Condition [number, condition]This command replaces old style conditional breaks; it changes a normal breakpoint into aconditional one. Arguments are a breakpoint number and a condition, which is evaluated in thecontext of the breakpoint. The breakpoint number is displayed when the break/tracepoint is set,and may also be obtained using the LIst Breaks command.ATtach Keystrokes [number, command]Arbitrary command strings can now be attached to break and tracepoints; they are executed by theDebugger when the breakpoint is taken. Arguments are a breakpoint number and a commandstring terminated with a CR. A CR can be embedded in the command string by quoting it with ^V.ATtach Loadstate [filename]Like ATtach Image, except that the initial rather than the current loadstate of the image file isused; this command is for wizards only.Break All Entries/Xits [module]This new command is the same as Trace All Entries/Xits, except that breakpoints are set.CLear Break [number]This command clears breakpoints by number. Typing CR in place of a number will clear thecurrent breakpoint, i.e., the one that transferred control into the Debugger.CLear Condition [number]This command changes a conditional breakpoint into a normal one. Typing CR in place of anumber behaves as in CLear Break.CLear Keystrokes [number]This command clears any command string associated with the breakpoint. Typing CR in place of anumber behaves as in CLear Break.LOgin [user, password]This command sets the default user name and password for the debugging session. The new username and password are not written into the client's core image or onto the disk.ReMote Debugee [host]This command is not implemented on the Alto.Trace StackThis command is used when the Debugger breaks and enters the debugger nub ("//" mode); itdumps the Debugger's call stack in octal to the log. Change requests reporting Debugger problemsthat result in an uncaught signal or other problem should be accompanied by a Debug.log whichincludes the output of this command. ftG bv ^xtxtx \Tp tps p tp Z' W^xtxtx Tp@ S<C QF O#x p Lxtxtx J#p\ H|B Fzpzp6zp Cxtx A px p C ?d' <xtx 9pxp" 6Kx tx 3p 'zp$ 2)M .xtx ,_pIzp *x p 'ixtx $p6zp #Gx p xtxtx }p@ P xtx  p, x CpLxp (9 Cxp M$ =]*Mesa 6.0 Debugger Update7InterpreterThe interpreter provides support for all of the new language features introduced in Mesa 6. Allcommands requiring numeric input now invoke the interpreter automatically (e.g., Octal Read:@p, n: SIZE[r]).GrammarA summary of the revised grammar is attached. The constructs ABS, ERROR, LONG, LOOPHOLE, MAX,MIN, NIL, POINTER TO, PROC, PROCEDURE, SIGNAL, WORD, and open and half open intervals have beenadded to the interpreter's grammar; type REAL has been added for output only. Type expressionsfollowing % must be enclosed in parentheses. The interpreter syntax Expression? has replacedthe Interpret Expression command; it prints the value of the expression in several formatsincluding octal and decimal.Target TypingThe interpreter now does a much better job of target typing. As a result, arguments to procedurecalls and right hand sides of assignments are type checked. In addition, assignments to enumeratedtypes now work correctly.The interpreter also does a better job of determining signed/unsigned representation. For example,any octal number is assumed to be unsigned.Symbol Lookup Even if a module has compressed symbols, the debugger will first look for the filemodulename.bcd to see if it is the original compiler output for that module (by checking theversion stamp). If so, it will use those symbols. Thus, there is no need to Attach Symbols if theproper file is on the disk. It makes sense to use compressed symbols for large systems and to alsohave present the complete symbol files for the specific modules undergoing detailed debugging. Output ConventionsIn display stack mode, variables declared in nested blocks are now shown indented according totheir nesting level.A "?" in a variable display now uniformly means that the value is out of range; ". . ." indicatesthat there are additional fields present which cannot be displayed due to lack of symbol tableinformation.When the debugger refers to a program module, it usually gives the address of its global frame, e.g.,"G: nnnnnB". If the module has not been started, the debugger now prints a "~" after the B. If amodule has not been started, the user should not modify the global variables of that module, norshould they be displayed, as they are uninitialized.New Error MessagesThe warning Eval stack not empty! will be printed if the debugger is entered via either aninterrupt or a breakpoint with variables still on the evaluation stack; this indicates that the currentvalue of some variables may not be in main memory, where the interpreter normally looks.Exceptions to this are at entry and exit breaks; the debugger has enough information to decode the ftG b ^pS ](Px [ p X2v Tp#spspspspsp S  M xpOxp [&vp 4 t Cp xp .9 < M(: v >]<Mesa 6.0 Debugger Update8argument records that are on the stack in this case (if the appropriate symbol tables are available).Before the debugger permits any breakpoints to be set using the source window, the creation date inthe source file is checked against the corresponding date recorded by the compiler in the BCD. Themessage Can't use of