There are some specialized inspectors (for example: image inspectors), which add more subviews and/or show the object additionally in a more user friendly form.
anObject inspect
or:
anObject basicInspect
to any object.
(see below for the difference between #inspect
and #basicInspect
).
Inspector openOn:anObject
If the inspected object contains a large number of indexed instance variables, only some of these are shown in the instance variable list initially (to save some time during startup of the inspector). In this case, the lists popup menu will contain an entry 'show more' to increase (double) the number of instance variables shown.
The variable list shown when dictionaries are inspected will show the
dictionaries keys instead of the raw (i.e. real) instance variables.
If this is not what you are interrested in, use #basicInspect:
,
which will open an inspector without this behavior.
To avoid overhead, the inspector will not update its list automatically.
To force an update (for example, after an orderedCollection has changed its
size) click on the self
entry in the list;
This will both update the list
AND show the objects printed representation in the value view.
You may run into an index error, if you select an entry in a variable
collection which is no longer valid due to a resize.
For example, try:
then, in the inspector, evaluate (doIt):
#(1 2 3) asOrderedCollection inspect
and finally click on the entry labelled '3' in the namelist.
Since the index 3 is no longer a legal one, you will run into a
debugger due to an index error. Continue or abort
in the debugger, and force an update in the inspector by clicking on the
self grow:2
self
entry.
Double clicking on a name/index in the instance variable list will open an inspector on this instance variables value.
#('one' #two 3.0 4) inspect
#('one' #two 3.0 4) asOrderedCollection inspect
#('one' #two 3.0 4) asOrderedCollection basicInspect
( #('one' #two 3.0 4) asOrderedCollection removeFirst; yourself ) inspect
( #('one' #two 3.0 4) asOrderedCollection removeFirst; yourself ) basicInspect
(Image fromFile:'bitmaps/SBrowser.xbm') inspect
(Image fromFile:'bitmaps/SBrowser.xbm') basicInspect
(Color yellow) inspect
(Color yellow) basicInspect
(Array new:400) inspect
#basicInspect
to an object will always open a
general inspector, which
shows instance variables as they are physically present in the inspected object.
In contrast, #inspect
is redefined in some classes to
open an inspector showing
the logical contents.
In some collections, the physical implementation uses an
extra collection to hold the contents.
Try inspecting an (nonempty) instance of Dictionary to see the difference:
(select all lines below, and doIt)
|d|
d := Dictionary new.
d at:#foo put:1.
d at:#bar put:2.
d inspect.
d basicInspect.
The states shown are:
The list is updated every few seconds, so be prepared for some delayed visibility of new processes.
A popup-menu allows some operations to be performed on a selected process. The debug function found there opens an inspector-like debugger on the selected process. This may be useful if some process is waiting on a semaphore and you want to see exactly where the wait is.
Note:
Since at the time of the view update, the active process is always
the process monitor itself, the distinction between run and active
states is probably useless.
The numbers shown are (top to bottom):
The history is updated twice a second.
Use the key-commands 'f' (for faster) and 's' (for slower) to change
the update interval.
Pressing 'r' (for reset) rescales the display.
The typical picture shown is some saw-tooth figure; memory use is usually growing until a new-space collection reduces the amount.
The memoryMonitor also provides a popup menu for common garbage collect operations:
A memoryUsageView is useful to find memory leaks.
In Smalltalk, these are not caused by not freeing memory, but instead
by keeping references to objects in globals or class variables.
The menu includes a function owners which opens an
inspector on all objects owning references to instances of the
selected class
(showing the names/indices of the instance variables, which hold a reference).
'xev'
Xwindow utility).
Copyright © Claus Gittinger Development & Consulting, all rights reserved
(cg@ssw.de)