more core docs
[io.git] / libs / iovm / io / Debugger.io
blobae5a37c00a31587cc933dcd13eae4d9f605c771c
1 Debugger do(
2 docDescription("To start debugging a coroutine, call
3 <pre>
4 Coroutine currentCoroutine setMessageDebugging(true)
5 </pre>
6 Then each message sent within that coroutine will cause the Debugger vmWillSendMessage slot to be activated and the Debugger slots: messageCoroutine, messageSelf, messageLocals, and message will be set with the values related to the current message send. You can override vmWillSendMessage to implement your own debugging mechanisms.")
8 docSlot("start", "Starts the debugger.")
9 start := method(
10 loop(
11 self vmWillSendMessage(self message name)
12 messageCoroutine resume
16 docSlot("vmWillSendMessage", "Override this method to implement your own debugging mechanisms. Default behavior is to print every message sent.")
17 vmWillSendMessage := method(
18 writeln("Debugger vmWillSendMessage(", self message name, ")")
21 docSlot("debuggerCoroutine", "Returns the coroutine used for the debugger.")
22 debuggerCoroutine := coroFor(start)
23 yield