Squeak Class Documentation category index | class index  
 
Debugger
  category: Tools-Debugger
  superclass: CodeHolder
  subclasses:

I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.

Special note on recursive errors:
Some errors affect Squeak's ability to present a debugger. This is normally an unrecoverable situation. However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger. Here is the chain of events in such a recovery.

* A recursive error is detected.
* The current project is queried for an isolationHead
* Changes in the isolationHead are revoked
* The parent project of isolated project is returned to
* The debugger is opened there and execution resumes.

If the user closes that debugger, execution continues in the outer project and layer. If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world.

instance methods
  accessing
  contents
contents:notifying:
contextVariablesInspector
doNothing:
interruptedContext
interruptedProcess
isNotifier
labelString
labelString:
proceedValue
proceedValue:
receiver
receiverInspector

  class list
  selectedClass
selectedClassOrMetaClass

  code pane
  contentsSelection
createSyntaxMorph
doItContext
doItReceiver
pc
pcRange
toggleSyntaxMorph

  code pane menu
  perform:orSendTo:

  context stack (message list)
  contextStackIndex
contextStackList
expandStack
fullyExpandStack
messageListIndex
selectedMessage
selectedMessageName
toggleContextStackIndex:

  context stack menu
  abandon
abandon:
browseMessages
browseSendersOfMessages
browseVersions
buildMessageBrowser
buildMorphicNotifierLabelled:message:
close:
contextStackKey:from:
contextStackMenu:shifted:
currentCompiledMethod
debugProceedMenu:
doStep
down
fullStack
mailOutBugReport
messageListMenu:shifted:
peelToFirst
proceed
proceed:
restart
selectPC
send
stepIntoBlock
up
where

  dependents access
  step
updateInspectors
wantsSteps

  initialize
  buildMVCDebuggerViewLabel:minSize:
buildMVCNotifierButtonView
buildMVCNotifierViewLabel:message:minSize:
buildMVCOptionalButtonsButtonsView
buttonRowForPreDebugWindow:
debugAt:
notifierButtonHeight
openFullMorphicLabel:
openFullNoSuspendLabel:
openNotifierContents:label:
optionalAnnotationHeight
optionalButtonHeight
optionalButtonPairs
optionalButtonRow
preDebugButtonQuads
preDebugNotifierContentsFrom:
release
wantsOptionalButtons
windowIsClosing

  message category list
  selectedMessageCategoryName

  notifier menu
  debug

  private
  checkContextSelection
contextStackIndex:oldContextWas:
externalInterrupt:
isolationRecoveryAdvice
lowSpaceChoices
newStack:
process:controller:context:
process:controller:context:isolationHead:
resetContext:
resumeProcess:
selectedContext

class methods
  class initialization
  initialize
openContext:label:contents:

  instance creation
  context:
context:isolationHead:
informExistingDebugger:label:

  opening
  openInterrupt:onProcess:

instance methods
  accessing top  
 

contents

Depending on the current selection, different information is retrieved.
Answer a string description of that information. This information is the
method in the currently selected context.


 

contents:notifying:

The retrieved information has changed and its source must now be
updated. In this case, the retrieved information is the method of the
selected context.


 

contextVariablesInspector

Answer the instance of Inspector that is providing a view of the
variables of the selected context.


 

doNothing:

Notifier window can't accept text


 

interruptedContext

Answer the suspended context of the interrupted process.


 

interruptedProcess

Answer the interrupted process.


 

isNotifier

Return true if this debugger has not been expanded into a full sized window


 

labelString


 

labelString:


 

proceedValue

Answer the value to return to the selected context when the interrupted
process proceeds.


 

proceedValue:

Set the value to be returned to the selected context when the interrupted
process proceeds.


 

receiver

Answer the receiver of the selected context, if any. Answer nil
otherwise.


 

receiverInspector

Answer the instance of Inspector that is providing a view of the
variables of the selected context's receiver.


  class list top  
 

selectedClass

Answer the class in which the currently selected context's method was
found.


 

selectedClassOrMetaClass

Answer the class in which the currently selected context's method was
found.


  code pane top  
 

contentsSelection

Return the interval of text in the code pane to select when I set the pane's contents


 

createSyntaxMorph


 

doItContext

Answer the context in which a text selection can be evaluated.


 

doItReceiver

Answer the object that should be informed of the result of evaluating a
text selection.


 

pc


 

pcRange

Answer the indices in the source code for the method corresponding to
the selected context's program counter value.


 

toggleSyntaxMorph


syntaxMorph ifNil:
[syntaxMorph _ self createSyntaxMorph inAScrollPane.
syntaxMorph color: Color paleOrange].
standardTextMorph visible ifTrue: [
standardTextMorph owner replacePane: standardTextMorph with: syntaxMorph.
syntaxMorph scroller firstSubmorph update: #contentsSelection.
] ifFalse: [
syntaxMorph owner replacePane: syntaxMorph with: standardTextMorph.
].


  code pane menu top  
 

perform:orSendTo:

Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked.


  context stack (message list) top  
 

contextStackIndex

Answer the index of the selected context.


 

contextStackList

Answer the array of contexts.


 

expandStack

A Notifier is being turned into a full debugger. Show a substantial amount of stack in the context pane.


 

fullyExpandStack

Expand the stack to include all of it, rather than the first four or five
contexts.


 

messageListIndex

Answer the index of the currently selected context.


 

selectedMessage

Answer the source code of the currently selected context.


 

selectedMessageName

Answer the message selector of the currently selected context.


 

toggleContextStackIndex:

If anInteger is the same as the index of the selected context, deselect it.
Otherwise, the context whose index is anInteger becomes the selected
context.


  context stack menu top  
 

abandon

abandon the debugger from its pre-debug notifier


 

abandon:

abandon the notifier represented by aTopView


 

browseMessages

Present a menu of all messages sent by the currently selected message.
Open a message set browser of all implementors of the message chosen.
Do nothing if no message is chosen.


 

browseSendersOfMessages

Present a menu of the currently selected message, as well as all
messages sent by it. Open a message set browser of all implementors
of the message chosen.


 

browseVersions

Create and schedule a message set browser on all versions of the
currently selected message selector.


 

buildMessageBrowser

Create and schedule a message browser on the current method.


 

buildMorphicNotifierLabelled:message:


 

close:

The argument is a controller on a view of the receiver.
That view is closed.


 

contextStackKey:from:

Respond to a keystroke in the context list


 

contextStackMenu:shifted:

Set up the menu appropriately for the context-stack-list, either shifted or unshifted as per the parameter provided


 

currentCompiledMethod


 

debugProceedMenu:


 

doStep

Send the selected message in the accessed method, and regain control
after the invoked method returns.


 

down

move down the context stack to the previous (enclosing) context


 

fullStack

Change from displaying the minimal stack to a full one.


 

mailOutBugReport

Compose a useful bug report showing the state of the process as well as vital image statistics as suggested by Chris Norton -
'Squeak could pre-fill the bug form with lots of vital, but
oft-repeated, information like what is the image version, last update
number, VM version, platform, available RAM, author...'

and address it to the list with the appropriate subject prefix.


 

messageListMenu:shifted:

The context-stack menu takes the place of the message-list menu in the debugger, so pass it on


 

peelToFirst

Peel the stack back to the second occurance of the currently selected message. Very useful for an infinite recursion. Gets back to the second call so you can see one complete recursion cycle, and how it was called at the beginning. Also frees a lot of space!


 

proceed

Proceed execution of the receiver's model, starting after the expression at
which an interruption occurred.


 

proceed:

Proceed from the interrupted state of the currently selected context. The
argument is the topView of the receiver. That view is closed.


 

restart

Proceed from the initial state of the currently selected context. The
argument is a controller on a view of the receiver. That view is closed.


 

selectPC

Toggle the flag telling whether to automatically select the expression
currently being executed by the selected context.


 

send

Send the selected message in the accessed method, and take control in
the method invoked to allow further step or send.


 

stepIntoBlock

Send messages until you return to the present method context.
Used to step into a block in the method.


 

up

move up the context stack to the next (enclosed) context


 

where

Select the expression whose evaluation was interrupted.


  dependents access top  
 

step

Update the inspectors.


 

updateInspectors

Update the inspectors on the receiver's variables.


 

wantsSteps

Overridden by morphic classes whose instances want to be stepped,
or by model classes who want their morphic views to be stepped.


  initialize top  
 

buildMVCDebuggerViewLabel:minSize:

Build an MVC debugger view around the receiver, and return the StandardSystemView thus created.


 

buildMVCNotifierButtonView


 

buildMVCNotifierViewLabel:message:minSize:


 

buildMVCOptionalButtonsButtonsView


 

buttonRowForPreDebugWindow:


 

debugAt:


 

notifierButtonHeight


 

openFullMorphicLabel:

Open a full morphic debugger with the given label


 

openFullNoSuspendLabel:

Create and schedule a full debugger with the given label. Do not terminate the current active process.


 

openNotifierContents:label:

Create and schedule a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired.


 

optionalAnnotationHeight


 

optionalButtonHeight


 

optionalButtonPairs

Actually, return triples


 

optionalButtonRow

Answer a button pane affording the user one-touch access to certain functions; the pane is given the formal name 'buttonPane' by which it can be retrieved by code wishing to send messages to widgets residing on the pane


 

preDebugButtonQuads


 

preDebugNotifierContentsFrom:


 

release

Remove references to objects that may refer to the receiver. This message
should be overridden by subclasses with any cycles, in which case the
subclass should also include the expression super release.


 

wantsOptionalButtons

The debugger benefits so majorly from the optional buttons that we put them up regardless of the global setting. Some traditionalists will want to change this method manually!


 

windowIsClosing

My window is being closed; clean up. Restart the low space watcher.


  message category list top  
 

selectedMessageCategoryName

Answer the name of the message category of the message of the
currently selected context.


  notifier menu top  
 

debug

Open a full DebuggerView.


  private top  
 

checkContextSelection


 

contextStackIndex:oldContextWas:


 

externalInterrupt:


 

isolationRecoveryAdvice

Return a notifier message string to be presented in case of recovery from recursive error by revoking the changes in an isolation layer. This surely ranks as one of Squeak's longer help messages.


 

lowSpaceChoices

Return a notifier message string to be presented when space is running low.


 

newStack:


 

process:controller:context:


 

process:controller:context:isolationHead:


 

resetContext:

Used when a new context becomes top-of-stack, for instance when the
method of the selected context is re-compiled, or the simulator steps or
returns to a new method. There is room for much optimization here, first
to save recomputing the whole stack list (and text), and secondly to avoid
recomposing all that text (by editing the paragraph instead of recreating it).


 

resumeProcess:


 

selectedContext


class methods
  class initialization top  
 

initialize

The class variables were initialized once, and subsequently filled with
information. Re-executing this method is therefore dangerous.


 

openContext:label:contents:

Open a notifier in response to an error, halt, or notify. A notifier view just shows a short view of the sender stack and provides a menu that lets the user open a full debugger.


  instance creation top  
 

context:

Answer an instance of me for debugging the active process starting with the given context.


 

context:isolationHead:

Answer an instance of me for debugging the active process starting with the given context.


 

informExistingDebugger:label:

Walking the context chain, we try to find out if we're in a debugger stepping situation.
If we find the relevant contexts, we must rearrange them so they look just like they would
if the methods were excuted outside of the debugger.


  opening top  
 

openInterrupt:onProcess:

Open a notifier in response to an interrupt. An interrupt occurs when the user types the interrupt key (cmd-. on Macs, ctrl-c or alt-. on other systems) or when the low-space watcher detects that memory is low.