SIMULA DEBUGGER

The SIMULA debugger allows a programme to be executed step by step and the local variables can be examined or modified

To use it, you must use the "-d" option when compiling (or linking) with the sim script. If a program is started with the -d option (see examples 1 and 1a below). Then the debugger takes control on programme entry. In example 2, the program has been compiled (linked actually) with the DEBUG package but it is started without the -d option. In this case, if an error occurs in the running program, the debugger takes control (see theLund Debug Guide (html) for more information).

Ex 1:
	% sim -d pgm
	
Ex. 1a:
	% sim -d -nr pgm
	% pgm -d

Ex 2:
	% sim -d -nr pgm
	% pgm 

Commandes UTILES:

  1. Display
  2. Help
  3. Out
  4. Next
  5. Line
  6. QUit

Other Web documents


Liste des commandes

Help Gives this text. ==== Help TOPIC gives more help on TOPIC ====
Next Execute one sourceline in the program.
Line Execute one sourceline in this block or until block is ready.
Proceed Proceed execution
Display Show sourcecode
Trace Set trace mode on/off
Stop Stop execution and/or report sourceline and view
At Set a breakpoint
Remove Remove a breakpoint or all breakpoints
Breaks Short for Show Breaks
Output Output given expression
Input Assign a value with a new value
If If BOOLEAN-EXPRESSION then SimDeb-Command(s)
While while BOOLEAN-EXPRESSION do SimDeb-Command(s)
View Show or change current viewpoint
Chain Show call chain
Set TAB, LIBRARY, LINELENGTH, EXTERNAL
Show Tab, Library, Linelength, Breaks, Modules
Use Command, Output Redirection of input/output
Cli Enter a new CLI (DG) or a new Shell (Unix)
Shell Enters a new Shell (Unix) or a new CLI (DG)
Type Type a file on the terminal
Prompt Change prompt in SimDeb.
UKI User Key Interrupt - (re) enters debugger
Debpoints Where can the debugger be entered.
@ Prefix for variables in simula predefined classes
Bye Terminate program
Exit Terminate program
Quit Terminate program

Help      Gives this text. ====  Help TOPIC gives more help on TOPIC ====
          help%all gives help on all topics.

         The sequence below writes the complete helptext on the file SHELP:
             & use output SHELP
             help%all
             & use output

Next      Execute one sourceline in the program.
          Next goes into called procedures. The execution is stopped before
          next sourceline is executed.
          Format: Next
                  Next count Executes count sourcelines
          See also UKI and Debpoints.

Line      Execute one sourceline in this block or until block is ready.
          Format: Line       The execution is stopped next time a sourceline
                             in THIS block is to be executed.
                  Line%Over  The execution is stopped when this block is
                             deallocated. I e after the procedure reached its
                             final end.
                  Line count Executes count sourcelines
          Line-command normally disables tracing during the execution.
          Line%Trace (and Line%Over%Trace) makes that the trace-mode set is
          used.
          Line%Over can not be combined with "Line count"
          See also UKI and Debpoints.

Proceed   Proceed execution
          The execution is continued.
          See also UKI and Debpoints.

Display   Show sourcecode
          Format:  Display [RANGE]

          Ex:      Display 200,30       Displays the lines 200 - 230
                   Display              Displays 10 lines
                   Display 30:35        Displays line 30 to 35

Trace     Set trace mode on/off
          Format:  Trace On [RANGE]
                   Trace Off
          Ex: trace on 10:100    All lines in the range 10 - 100 is displayed
                                 before they are executed.

Stop      Stop execution and/or report sourceline and view
          In a breakpointcommand the STOP command stops execution and resumes
          user dialouge, otherwise it prints out current source line

At        Set a breakpoint
          Insertes a breakpoint in the module that is viewed at the moment.

          Ex: AT 23 output i,j;stop
              AT 67 o%all

Remove    Remove a breakpoint or all breakpoints
          Format:  remove at LINE# [in MODULENAME]  ! Removes one breakpoint
                   remove%all                       ! Removes all breakpoints

Breaks    Short for Show Breaks
          See also Help Show

Output    Output given expression
          Ex: Output x
              Output i,Arr(i)
              Output p.@Suc%all
              out%local               ! Shows all debugger local variables
                                      ! See under input for information on
                                      ! local variables

          %ALL gives all visible variables
          Ex: output%all     - shows all variables in current block (including
                               prefixblock if any)
              output p%all   - gives all variables in the block p is denoting
                               or all elements if p is an array

          NOTE: In "declaration mode", ie after View%Declaration, no dot
                expression is accepted.
                Output SomeProcedureName%all gives all declaration in the
                                             procedure.

Input     Assign a value with a new value
          Ex: INPUT i := 7           ! the variable i is given a new value
              INPUT $p :- none       ! The local variable $p is set to none

          Variable name which contains a $ are treated as debugger local
          variables. They are given the same type as the right hand
          expression.
          NOTE: Text-variables can currently not be assigned with new values.

If        If BOOLEAN-EXPRESSION then SimDeb-Command(s)

          Ex: AT 9 IF i > 45 THEN s                ! Stops at line 9 when i > 45
              IF i*9 <= 56 THEN output i; IN i:=0  ! Show i and set it to 0

While     while BOOLEAN-EXPRESSION do SimDeb-Command(s)
          Ex: while p$r =/= none do output p$r%all;in p$r :- p$r.next

              in $p :- List.@suc                 ! Assign local with list.First
              while $p in LINK do o $p%all; in $p :- $p.@suc
                                                 ! traverse list and output its
                                                 ! elements

              NOTE: Both p$r and $p in the examples above are local variables.

View      Show or change current viewpoint
          view                 Shows current viewpoint
          view%up              Change view one static level up
                               It is not possible to use this command when
                               viewpoint is at outermost level in an external
                               module.
          view%return          Change view to dynamic father
          view%entry           Change view to same viewpoint as when the
                               debugger was entered.
          view ref-expression  Change view to the object specified in ref-
                               expression
          view%previous        Change view to the previous one

          view%declaration     Enter "declaration mode". Makes it possible to
                               examine declarations and not values. In this
                               mode "view exp" changes view to the
                               declaration of exp.
                               The mode is left with view%ent.


Chain     Show call chain
          The dynamic call chain from viewed activation is showed. Line number
          is given, where the call occured (if not -h (unix) /h (DG) was given
          at compile time)

Set       TAB, LIBRARY, LINELENGTH, EXTERNAL

          Set TAB  Sets tabulation stop on output
                   All TABs are converted to space:s on Simuladebs
                   output. Initially tabstops are set every 3:rd
                   position.

          Set LIBRARY
                   Set path of directories in which SimDeb searches
                   for source- and symboltable-files in.
             Ex:
               set lib /usr/myhome/    (UNIX)    Adds myhome last in PATH
               set lib :UDD:MYHOME:    (AOS/VS)  NOTE trailing / (:)
               set lib%2 cat/                    adds cat at place 2 in PATH
               set lib%-2                        removes the 2:nd entry in PATH

             NOTE: Simuladeb concatenates the given libraryentry with the
                   filename. This gives that LibEntry & filename must be the
                   complete filename.
             Se also Show Library

          Set LINELENGTH
                   Set "image"-length on simuladebs output.
                   Default are 80.

          Set External
                   Force Simuladeb to search for all external declarations.
                   This command can be very timeconsuming. At startup Simuladeb
                   always reads in external declaration in outtermost block
                   in main program.
                   Use this command when the debugger is unable to find
                   a path to an external module when setting breakpoints in
                   it.
                   See also show modules.

Show      Tab, Library, Linelength, Breaks, Modules

          Show Tab            Show current tab-stop value
          Show Library        Show current searchlist
          Show Linelength     Show current linelength
          Show Breaks         Show all breakpoints set. This command may be
                              abbreviated to only Breaks.
          Show Modules [name] Without parameter the command lists all external
                              modules known, with a status on sourcefile and
                              symboltablefile.
                              Status OK    - The file has been succesfully read
                                     Fail  - File not found or other error
                                     ?     - no attempt to open the file has
                                             been done
                              With parameter (a modulename) that module is
                              listed with some more information.

Use       Command, Output      Redirection of input/output

          USE COMMAND FileName    ! All input to SimDeb is read from FileName
          USE COMMAND             ! Input is reset to terminal

          USE OUTPUT FileName     ! All output from SimDeb is sent to FileName
          USE OUTPUT              ! Output is sent to terminal


Cli       Enter a new CLI (DG) or a new Shell (Unix)
          Creates a new CLI on DG-AOS/VS systems and a new shell (csh) on Unix
          Exactly equivalent with the Shell-command

Shell     Enters a new Shell (Unix) or a new CLI (DG)
          Creates a new shell (csh) on Unix systems and a new CLI on DG-AOS/VS
          Exactly equivalent with the Cli-command

Type      Type a file on the terminal
          Ex:   Type /usr/myhome/indata_file

Xdebug    Enters assembler debugger. ONLY on DataGeneral - AOS/VS
          The DEB is entered. To be able to enter breakpoints and make
          memory modifications the program must have been started with DEB.

Prompt    Change prompt in SimDeb.
          Initially set to &

UKI       User Key Interrupt - (re) enters debugger
          This can be given at any point during execution of the program.
          The program execution stops before next sourceline starts to
          execute.
          See also Debpoints

Debpoints Where can the debugger be entered.
          The simula runtimesystem checks if the debugger should be entered
          before a sourceline starts to execute. However, if the program
          (or module) is compiled with h-option no such tests are performed.
          This means that the execution is continued until a module compiled
          without h-option is reached.

@         Prefix for variables in simula predefined classes
          To be able to examine normally not accesseble variables inside
          predefined simula classes they are given with a leading @.
          Such varibles are read-only in the debugger.

          Ex: LINK class A(i); integer i;;
              ref (A) ap;
              ap :- new A(5);

              In debugger:
              & o ap%all
              AP :           ref to class: A
              I :            5
              --------- From class LINKAGE----------------
              @Suc :         None
              @Pred :        None

Bye       Terminate program
Exit      Terminate program
Quit      Terminate program