You can make changes to the selected method while being in the debugger.
When accepting, a new method is created and installed in the receiver's
class as usual. It will be executed when the corresponding message
is sent the next time to the receiver.
However, when you proceed or single step,
the original method which was active when the debugger entered
and which is still in the calling chain, is resumed.
Therefore, it is best to resend, restart or abort the execution.
Please read the chapter on "Restarting / Returning",
for more information on effect and limitations in those functions.
The debugger will show an indicator ("Showing Original" vs. "Showing current Version")
to remind you about which version of the code you are looking at, after a code change.
The MiniDebugger is a stripped down version of the Debugger,
which does not offer a graphical user interface,
but is controlled by entering commands to the (x-)terminal or console window,
in which ST/X was started
(*).
The MiniDebugger is entered
- if a severe error happens within the Debugger itself,
- or if you are running a standalone Smalltalk application without a graphical debugger
- or without graphical classes at all,
- or if an error is encountered in
scripting mode.
- or by pressing CTRL-C in console (if there is one)
- or by sending ST/X a signal (SIGILL, SIGFPE or SIGINT) from a shell (unix only)
Of course, any debugger is entered directly or indirectly via an
emergency exception handler.
So you can define your
own action to be called for unhandled exceptions and suppress a debugger.
In most deployed end-user apps, a handler showing a warning box
would probably be installed.
To get a list of available miniDebugger commands, type
"?" (question-mark) at its prompt.
The most useful MiniDebugger commands are:
'?'
- help; lists available commands
'c'
- continue (same as corresponding debugger function)
'a'
- abort (same as corresponding debugger function)
'T'
- terminate the process.
Be careful to not terminate the event dispatcher or scheduler.
'p'
(lower case)
- print walkback. This shows the context chain in a format
similar to what is shown in the graphical debugger.
'P'
(upper case)
- print processes. This outputs a list of known processes
with their process ids and names.
'U'
and 'D'
(both upper case)
- removes all method- and statement breakpoints from the system.
Useful, if you are cought in a debugger loop, after placing a
breakpoint in a heavily used system- or redraw method.
'x'
- exit smalltalk. This exits the system immediately, without asking
any questions. Think about issuing an 'S' or 'C' command before doing that.
'I'
- enter a line-by-line emergency interpreter.
Leave the interpreter by entering "#exit".
'C'
- save the changes made during this session to a separate changefile.
This changefile can be reapplied or investigated once you restarted
ST/X. Of course, the regular changefile will also contain these changes,
but also all intermediate one's, which may now be obsolete.
So the file saved here contains a condensed
set of changed methods. This is the same function that is also provided by the
Launcher's "Save Session Changes" menu function.
'S'
- save an emergency image into the file "crash.img".
Depending on how corrupted the current state of the system is,
this image may or may not be able to be restarted.
In most cases, it is worth a try.
But think about issuing a 'C' command in addition.
Even if the saved image is not restartable, it may still be investigated
via the "Snapshot Image Browser", which can be opened via the Launcher's menu.
From within that, it should be possible to fileOut relevant classes and
reload/browse them after a fresh start.
Hint: Emergency Repair in the Minidebugger
If you really messed up the system by accepting bad code in a critical part of the system
(for example: the event handling or process scheduling mechanism),
it is sometimes possible to repair this in a minidebugger
by recompiling the bad method.
For this, enter a line-by-line interpreter ("I"-command),
and type:
<className> compile:'<nameOfMethodWithArguments>
...
fixed code here
...
'
Footnotes
(*)
Under the Windows operating system, the MiniDebugger is only available if you started
the console-version "stx.com
" - not the non-console version: "stx.exe
".
Doc $Revision: 1.15 $ $Date: 2020/12/10 02:58:33 $