eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'MiniDebugger':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: MiniDebugger


Inheritance:

   Object
   |
   +--MiniDebugger

Package:
stx:libbasic
Category:
System-Debugging-Support
Version:
rev: 1.136 date: 2019/03/12 21:36:41
user: cg
file: MiniDebugger.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Claus Gittinger

Description:


a primitive (non graphical) debugger for use on systems without
graphics or when the real debugger dies 
(i.e. an error occurs in the graphical debugger or the UI/event handler is broken).
This one is also called for, if an interrupt occurs within the debuger, 
or if CTRL-C is pressed in the controlling tty/console.
Needs a console.

    MiniDebugger enter

Attention:
    all printing is done via lowLevel _errorPrint messages,
    to ensure that output is to stderr, even if a logger is present, 
    or Stderr has been set to some other stream (Transcript).
    Also to avoid the logger's interfering and adding imestamp information.
    


Class protocol:

instance creation
o  enter
enter a miniDebugger

usage example(s):

     MiniDebugger enter

o  enter: aContext withMessage: aString mayProceed: mayProceed
enter a miniDebugger

o  enter: aContext withMessage: aString mayProceed: mayProceed input: inputStreamOrNil
enter a miniDebugger

o  enterException: ex
enter a debugger; if this is a recursive invocation, enter
a MiniDebugger instead.
This is the standard way of entering the debugger;
sent from error- and halt messages.

o  enterWithMessage: aString mayProceed: mayProceed
enter a miniDebugger

o  new
redefined to make certain that there is only one miniDebugger
in the system

o  openOn: aProcess
enter a miniDebugger

o  singleStep: aBlock

o  trace: aBlock

o  trace: aBlock on: aStream

o  trace: aBlock with: aTraceBlock


Instance protocol:

accessing
o  inputStream: aStream
if non-nil, the debugger will read its input from there.
This allows for a miniDebugger to be used in a telnet stream (scripting)

entering
o  enter: aContext mayProceed: mayProceed
regular entry, via unhandled exception

o  stepInterrupt
entry via single stepinterrupt

usage example(s):

where is stepInterrupt context

initialization
o  initialize

private
o  findContext: aSelector
got it

o  garbageCollectCommand: id

o  getCharacter
globally blocking

o  getContext
remove Debugger commandLoop frame

o  moveDotDown
sigh - must search

o  moveDotUp
dot fullPrint.

o  printBacktraceFrom: aContext

o  printContext: aContext
print the receiver, selector and args of the context

o  printDot
' args: ' _errorPrint. (argNames ? #() asStringWith:$;) _errorPrintCR.

o  printDotsMethodSource

o  printDotsMethodSource: full

o  stepping

o  tracingWith: aBlockOrNil

user commands
o  commandLoop
read-eval commands, until one of the continue, abort or single step commands is entered;
return the last command character

o  doAbort
TEMPORARY kludge - find event handler context
this will be removed, once real debugging is possible

o  doCommand: cmd
a single command;
return true, if command loop should be finished

o  getCommand: prompt
Screen notNil ifTrue:[

o  helpOn: commandArg

o  interpreterLoopWith: anObject
|line done rslt|

o  printAllBacktraces

o  showProcesses

o  showProcesses: how
' sys:' _errorPrint. (p isSystemProcess ifTrue:'y' ifFalse:'n') _errorPrint.

o  showValidCommandHelp



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 24 Apr 2024 19:01:54 GMT