How to use MiniDebugger

Tagged:  •  

First you need to load MiniDebugger in your image.

gst -K examples/ -S

You may have to sudo it.

su -c 'gst -K examples/ -S'

This will save the image with MiniDebugger loaded.
Next time you encounter a exception the MiniDebugger will prompt.

You can type help for more info:

[mathk@mathk examples]$ gst
GNU Smalltalk ready

st> self halt
'nil error: halt encountered'
Halt(Exception)>>signal (
Halt(Exception)>>signal: (
UndefinedObject(Object)>>halt: (
UndefinedObject(Object)>>halt (
UndefinedObject>>executeStatements (a String:1)
      6         ^self activateHandler: (onDoBlock isNil and: [ self isResumable ])
(debug) help
Control flow commands:
    s [n]      step N times
    n [n]      next (step over send) N times
    f [n]      finish current method N times
    c          continue

Process commands: no ID means debugged process
    P          show process list
    T [id]...  terminate process
    K [id]...  kill process - no unwinds or cleanup
    b [id]...  backtrace

Examining state:
    r          print receiver on stdout
    i          inspect (enter MiniInspector on current receiver)
    I          inspect context (enter MiniInspector on current context)
    e          eval (enter read-eval-print loop on current receiver)

Examining the call stack:
    u [n]      go N frames up (default 1)
    d [n]      go N frames down (default 1)
    l          print current method
    w          print current frame

Other commands:
    g          collect all garbage
    X          exit Smalltalk, and dump core
    x          exit Smalltalk

User login