home *** CD-ROM | disk | FTP | other *** search
- 6/28/88:
- This information should be divided into many small files,
- put in a separate directory, and called on demand on line.
- Good exercise!
-
- FORMAT of the online commands:
- command_name: arg_type
- arg_type can be Int, NoArg, Atom or Const.
- An atom is just a string; a Const is either an Atom or an Int.
-
- REMINDER: ">" is the pas prompt.
-
- xreg: Int
- prints the contents of the specified X register.
- X1 is xreg 0, X2 xreg 1,...
-
- yreg: Int
- prints the contents of the specified Y register.
- Y1 is yreg 0, Y2 yreg 1,...
-
- step: NoArg
- executes one byte-code
-
- next: NoArg
- continues execution up to the next procedure call or the end of the program,
- whichever comes first.
-
- run: NoArg
- run the loaded program.
-
- trace: Atom
- without argument, gives some help.
- Can trace gc activity, instruction executed, only procedure calls,
- value of xreg at each instruction traced, the variations of the heap
- at each failure, and the max amount of control stack used.
- To check what is traced, call status.
- trace [g,i,c,x,h,s]: each one works independently as a flip-flop.
- > trace h % starts to trace heap variations
- > trace h % stops heap variation traces.
-
- list: Int
- list the code, from the specified argument. Defaults to 0.
- The code really starts at -5. The first 5 byte codes are
- for the environment. The loaded code starts at 0.
-
- load: Atom
- load a program. Should be a filename without suffix.
- > load qsort
- > load dir/tak
- Expects that the files qsort.w and dir/tak.w exists.
- Complains otherwise.
-
- help: NoArg
- prints the list of available commands.
-
- reg: Atom
- prints the contents of WAM system registers.
- reg [h,e,b,tr] (see the WAM documentation for H,E,B,TR).
- > reg h
-
- reset: NoArg
- Reinitialize the environment. (reset registers,...)
- Automatically called by run.
-
- stop: Int
- sets a break point at specified line. Works as a flip-flop.
- Only one break point is possible at a time. To remove the break point,
- just say: stop.
- > stop 10 % set a break point at line 10
- > stop % remove the break point
- To check whether a break point is set or not, do:
- > status
-
- cont: Int
- Traditional continues (like in dbx) continues execution up to the next
- break point. I think this is rather useless. Much more useful is to
- be able to continue up to a specified number of occurrences of the
- break point. It is what this cont with one argument does.
- > cont 3 % skips three break points and stop to the next one.
-
- print: Atom
- print [e,b]: prints the contents of the current environment or choice point.
- Obsolete.
-
- compile: Atom
- compile a file and then loads it.
- > compile a % expects a.pl or a.w to be there. If a.w is there,
- loads it. Otherwise compile a.pl and loads the resulting a.w
-
- status: NoArg
- gives information on what is currently traced, if the break point is set,
- whether profiling is under action.
-
- breadth: Int
- Sets the breadth limit for printing things. Mainly used to print out
- results; also used by heap (not very elegant; should be changed).
-
- depth: Int
- Sets the depth limit for printing recursive objects.
- In conjunction with breadth, very useful to debug programs
- and to go over circular structures.
-
- mem: NoArg
- prints the amount of memory used in words.
- (currently, 1 word = 32 bits)
-
- env: Int
- prints the number of environments specified, starting from the top.
-
- cp: Int
- prints the number of choice points specified, starting from the top.
-
- profile: NoArg
- starts/stops profiling (flip-flop). status tells you which state is active.
- To get the result of the profiling, just list the program using list.
-
- argtypes: NoArg
- used to record the argument types at each procedure call.
- listproc can then be used, after execution of the program,
- to see with what argument each procedure was called.
-
- listproc: NoArg
- (see argtypes)
-
- database: Const
- allows the user to read the contents of a value stored by
- a set (see set & access).
- (inside program: set(foo, bar(bar)))
- > dababase foo
- bar(bar)
-
- heap: Int
- prints the contents of the heap, starting at the specified location.
- The number of entries printed is given by breadth.
- If you use the garbage collected version, things
- won't appear first at location 0, rather you should do:
- > reg h
- to get the first used location.
-
- table: Const
- similar to database
-
- heapusage: NoArg
- give the results on the usage of the heap. First should run
- the program with trace h on.
-
- window: Int
- only for the garbage collector. Specifies the size of the gc window.
-
- gc_data: NoArg
- prints performance data concerning garbage collection. After executing
- the program!
-
- echo: Atom
- Like the shell echo. Just copies its input verbatim. Used in pas scripts.
-
- fast: NoArg
- like run. But does not support any tracing, break point, etc...
- 30% faster than run.
-
- strings: NoArg
- spits out the string table. Useful only for heavy debugging.
-
- gc: Atom
- specifies one gc algorithm.
- > gc % will gives you the current algorithm and window size
- > gc h % will give you a selection of no less than five algorithms!
- Don't worry about that very much; the default value is the best choice.
-
- gc_verbose: NoArg
- flip-flop. When sets, gives info on the gc activity.
-
- gc_limit: Int
- should not be of any use; only for debugging the garbage collector.
- Stops the emulator after that many calls to the garbage
- collector.
-
- stack_usage: NoArg
- to be used only after a program is executed with trace s on.
- Gives the max stack usage by the program.
-