From VisualWorks®, 7.6 of February 8, 2008 on March 3, 2008 at 9:43:52 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <name>CraftedSmalltalk</name> <environment>Smalltalk</environment> <private>true</private> <imports> private Smalltalk.* </imports> <category>CraftedSt</category> <attributes> <package>Debugger-Probes</package> </attributes> <class> <name>AbstractCodeProbe</name> <environment>CraftedSmalltalk</environment> <super>Core.Object</super> <private>false</private> none probeRecord parent <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.AbstractCodeProbe
AbstractCodeProbe Version 1.0 Copyright 1995,1996 Crafted Smalltalk All Rights Reserved AbstractCodeProbe is the abstract class of all the software probes. It primarily provides the methods for accessing the information within the probe record. Instance Variables: probeRecord <ProbeInsertionRecord> The probe record. parent <CodeProbe> The probe from which the receiver was copied. Class Variables: DoClone <Boolean> This specifies what type of copying will be done when a probe is copied.
</comment> <class> <name>ProbeClone</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.AbstractCodeProbe</super> <private>false</private> none <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeClone
ProbeClone Version 1.0 Copyright 1995,1996 Crafted Smalltalk All Rights Reserved A ProbeClone is a copy of a probe and is used only in temporary methods. It exists so when a user modifies a probe in the debugger that the actual probe contained in the probed method in the method dictionary is modified and not simply the probe in the temporary method.
</comment> <class> <name>PDPInstrumenterGUIModel</name> <environment>CraftedSmalltalk</environment> <super>UI.ApplicationModel</super> <private>false</private> none classUnderTest basicTypeModel subclassModel conditionalModel panelList methods winParamButtonW winParam reportModel instrumenter ivarMenu ivarMenuModel <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPInstrumenterGUIModel
PDPInstrumenterGUIModel Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved The PDPInstrumenterGUIModel is the abstract instrumentation GUI model class. It and its Subclasses control the instrumentation panel GUIs. The actual instrumentation of methods is done by an instance of a PDPInstrumenter subclass.
</comment> <class> <name>PDPMsgRcvdInstrumenterGUIModel</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.PDPInstrumenterGUIModel</super> <private>false</private> none ivarMenuButton <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPMsgRcvdInstrumenterGUIModel
PDPMsgRcvdInstrumenterGUIModel Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved
</comment> <class> <name>PrintTimeoutError</name> <environment>CraftedSmalltalk</environment> <super>Core.Error</super> <private>false</private> none <imports></imports> <category>CraftedSt-Dbgr support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PrintTimeoutError
PrintTimeoutError This exception is raised (in some inspectors) when printing an object takes so long that it becomes highly probable that the printing suffers from infinite recursion.
</comment> <class> <name>CodeProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.AbstractCodeProbe</super> <private>false</private> none testMethod testSource variables labelString permanent <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.CodeProbe
CodeProbe Version 1.1 Copyright 1995,1998 Crafted Smalltalk All Rights Reserved An instance of CodeProbe is used as a breakpoint probe. It provides most of a probe's functionallity. Instance Variables: testMethod <CompiledMethod> The method that is executed to determine if the probe should be activated. testSource <String> Souce for the test method. variables <Dictionary> Dictionary of the probe's local debug variables. labelString <ValueHolder of: (nil | String)> Window label permanent <Boolean> Permanent or temp probe Class Variables: DebugActiveMethod <CompiledMethod> Used to initialize an unconditional test method. The result returned is the value of the #DebugActive global debug variable. This is set the by visual launcher probe menu command "enable debugging". DefaultTestMethod <CompiledMethod> The defauld method used to initialize an unconditional test method DefaultTestSource <String> The source string of the default test method. TrueTestMethod <CompiledMethod> Used to initialize an unconditional test method FalseTestMethod <CompiledMethod> Used to initialize a conditional test method
</comment> <class> <name>DisplayProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.CodeProbe</super> <private>false</private> none windowID <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayProbe
DisplayProbe Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved The super class of all the watchpoint probes. Instance Variables: windowID <Symbol> ID of the watch window
</comment> <class> <name>DisplayVariableProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.DisplayProbe</super> <private>false</private> none index name <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayVariableProbe
DisplayVariableProbe Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved The super class of the probes that display the contents of a defined variable. Instance Variables: index <Integer> The variable index. name <String> The variable name.
</comment> <class> <name>DisplayMethodVarProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.DisplayVariableProbe</super> <private>false</private> none slot <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayMethodVarProbe
DisplayMethodVarProbe Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved When activated an instance of a DisplayMethodVarProbe displays the contents of a method temporary variable.
</comment> <class> <name>ProbeExpressionEditor</name> <environment>CraftedSmalltalk</environment> <super>UI.ApplicationModel</super> <private>false</private> none probedMethod probedClass probe textMenu expressionLibrary <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeExpressionEditor
ProbeExpressionEditor is the abstract super class for the probe expression editors. It is responsible for most of the probe expression editing activity. It provides the menu commands for accessing and defining variables. It also provides proper variable scope so the expressions will be able to refer to variables within an instance of probedClass. ProbeExpressionEditor allows a client to store and retrieve expressions in its class instance variable, expressionLibrary, a dictionary. This Dictionary can is accessed by methods in the class side method protocol: #'expression library'. Expressions are stored as strings and are accessed by the name a client decides is appropriate (the current implementation converts any expression names into symbols). Instance Variables: probedMethod <ProbedCompiledMethod | nil> The method being probed. probedClass <Class> The class of the method being probed probe <Probe> The probe being operated on. textMenu <Menu> The text menu. A new text menu is supplied because additional commands are provided. Class Instance Variables: expressionLibrary <Dictionary of: Symbol->String> The current collection of stored expressions
</comment> <class> <name>ProbeTestExpressionEditor</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.ProbeExpressionEditor</super> <private>false</private> none <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeTestExpressionEditor
The ProbeTestExpressionEditor tailors the ProbeExpressionEditor for test expressions. Most of the specialization is for accessing the test expression and method.
</comment> <class> <name>PDPIVarRefInstrumenterGUIModel</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.PDPInstrumenterGUIModel</super> <private>false</private> none readModel writeModel <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPIVarRefInstrumenterGUIModel
PDPIvarRefInstrumenterGUIModel Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved
</comment> <class> <name>RemovedProbedMethodsBrowser</name> <environment>CraftedSmalltalk</environment> <super>UI.ApplicationModel</super> <private>false</private> none methods methodList hiddenMethods selectedMethods showHidden textHolder <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.RemovedProbedMethodsBrowser
RemovedProbedMethodsBrowser Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved The RemovedProbedMethodsBrowser is used to browse and manage ProbedCompiledMethods that were removed as a result of recompiling a class. With a RemovedProbedMethodsBrowser the user can browse and select methods so that their probes may be reinserted. Instance Variables: methods <SortedCollection of: ProbedCompiledMethod> The list of methods to be used for browsing or probe reinsertion. methodList <MultiSelectionInList of: ProbedCompiledMethod> The list of methods being displayed. hiddenMethods <SortedCollection of: ProbedCompiledMethod> A list of methods that were removed from "methods". selectedMethods <Array of: ProbedCompiledMethod> The list of methods selected by the user. showHidden <Boolean> If true, "hiddenMethods" is displayed instead of "methods" textHolder <ValueHolder on: Text> Holds the selected method's source text.
</comment> <class> <name>PDPWeakDictionary</name> <environment>CraftedSmalltalk</environment> <super>Core.Collection</super> <private>false</private> none keyArray valueArray tally accessLock <imports></imports> <category>CraftedSt-Dbgr support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPWeakDictionary
PDPWeakDictionary Version 1.1 Copyright 1995,1997 Crafted Smalltalk All Rights Reserved PDPWeakDictionary is a partial implementation of an identity dictionary. It was done so that either the keys or the values could be weak references. Instance Variables: accessLock <RecursionLock> Protects elements from conflicting access during use and element expiration. keyArray <Array | WeakArray> The keys. valueArray <Array | WeakArray> The values. tally <Integer> The number of items in the dictionary. Class Variables: "Copied from Set" ImproperCreationSizeSignal <Signal> Used to indicate an attempt to create an instance with an inappropriate size. PrimeMap <ByteArray> Used to map the first some integers to primes, used in calculating instance sizes -- prime numbers make good hash divisors. Each byte contains the distance from the index'th odd number to the nearest higher prime. MaxMapped <Integer> Last integer that is mapped by PrimeMap.
</comment> <class> <name>BreakInterrupt</name> <environment>CraftedSmalltalk</environment> <super>Core.ControlInterrupt</super> <private>false</private> none <imports></imports> <category>CraftedSt-Dbgr support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.BreakInterrupt
BreakInterrupt BreakInterrupt is the exception that is raised to cause a breakpoint action.
</comment> <class> <name>CodeProbeEditor</name> <environment>CraftedSmalltalk</environment> <super>UI.ApplicationModel</super> <private>false</private> none originalProbe workingCopyProbe closeAction probedMethod probedClass testEditor <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.CodeProbeEditor
An instance of CodeProbeEditor is the model for a code probe editor panel. It serves two purposes; to build the panel, and to perform the appropriate action when the panel is closed. Instance Variables: originalProbe <CodeProbe> The probe for which the editor was opened. workingCopyProbe <CodeProbe> A copy of the object ivar. This is the actual probe that is operated on. This is used so a cancel actually works. closeAction <BlockClosure> This block is performed when the panel is closed via the Done button. probedMethod <ProbedCompiledMethod> The probed method. probedClass <Metaclass> The class containing the probed method. testEditor <ProbeExpressionEditor> The editor for the test expression.
</comment> <class> <name>ProcessTerminatedDuringSimulation</name> <environment>CraftedSmalltalk</environment> <super>Core.GenericException</super> <private>false</private> none <imports></imports> <category>CraftedSt-Dbgr support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProcessTerminatedDuringSimulation
ProcessTerminatedDuringSimulation The ProcessTerminatedDuringSimulation exception is raised if the process is terminated during byte code simulation.
</comment> <class> <name>ProbeActionExpressionEditor</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.ProbeExpressionEditor</super> <private>false</private> none <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeActionExpressionEditor
The ProbeActionExpressionEditor tailors the ProbeExpressionEditor for action expressions. Most of the specialization is for accessing the action expression and method.
</comment> <class> <name>AuxCodeInfoExtractor</name> <environment>CraftedSmalltalk</environment> <super>Kernel.InstructionStream</super> <private>false</private> none depth jumpStack maxDepth visited <imports></imports> <category>CraftedSt-VM</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.AuxCodeInfoExtractor
An instance of a AuxCodeInfoExtractor is used to extract stack depth and jump destinations from a compiled method. Instance Variables: depth <Integer> Current stack depth jumpStack <OrderedCollection of: Association> The key is the pc of a jump instruction and the value is the stack depth. maxDepth <Integer> Maximum stack depth used in the method visited <Array of: Boolean> A visitation record of every instruction in the method. It is used to make sure that every instruction in every branch is visited.
</comment> <class> <name>DisplayActionProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.DisplayProbe</super> <private>false</private> none actionMethod actionSource <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayActionProbe
DisplayActionProbe Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved Instances of DisplayActionProbe are used to display the result of a Smalltalk expression. Instance Variables: actionMethod <CompiledMethod> The method that is evaluated to obtain a string to display. actionSource <String> Source code of the action method. Class Variables: ActionMethod <CompiledMethod> Used to initialize the action method.
</comment> <class> <name>PDPWeakCollection</name> <environment>CraftedSmalltalk</environment> <super>Core.Collection</super> <private>false</private> none accessLock elements <imports></imports> <category>CraftedSt-Tools support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPWeakCollection
PDPWeakCollection Version 1.1 Copyright 1995,1996,1997 Crafted Smalltalk All Rights Reserved PDPWeakCollection is a collection that uses a WeakArray to contain the elements. Complete collection protocol has not been implemented. Instance Variables: elements <WeakArray> The collection of objects. accessLock <RecursionLock> Protects elements from conflicting access during use and element expiration.
</comment> <class> <name>PDPInstrumenter</name> <environment>CraftedSmalltalk</environment> <super>Core.Object</super> <private>false</private> none classUnderTest templateProbe instrumentationRecords labelStream probeClass probedMethod leadString methodString probeRecord probe iVarName iVarIndex startingScope probeCompletionSelector useConditionalProbe selectWindowParams instrumentationRequest reportStrings <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPInstrumenter
PDPInstrumenter Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved The PDPInstrumenter is an abstract instrumentation class. Subclasses provide the functionality to instrument a set of methods. Instance Variables: classUnderTest <Metaclass> Class being instrumented templateProbe <CodeProbe> A probe that serves as a template for creating additional probes. instrumentationRecords <OrderedCollection of: MethodActionRecord> These record what methods should be instrumented. labelStream <WriteStream> Used to create the probe label. probeClass <CodeProbe class> probedMethod <ProbedCompiledMethod> The actual method being probed. leadString <String> methodString <String> probeRecord <ProbeInsertionRecord> This specifies were in the method a probe is to be inserted. probe <CodeProbe> The probe being inserted. iVarName <String> The name of the instance variable being monitored. iVarIndex <Integer> The index of the instance variabe being monitored. startingScope <NameScope> This is the scope used in compiling the probe expressions. probeCompletionSelector <Symbol> The method used to complete each probe. useConditionalProbe <Boolean> Specifies whether a code editor is opened to allow the test expression to be edited. selectWindowParams <Boolean> Specified whether the dialog is opened to permit the watch window parameters to be changed. instrumentationRequest <Symbol> The request being processed. It the selector of the method that initiates the instrumentation process.
</comment> <class> <name>PDPMsgRcvdInstrumenter</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.PDPInstrumenter</super> <private>false</private> none <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPMsgRcvdInstrumenter
PDPMsgRcvdInstrumenter Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved The PDPMsgRcvdInstrumenter is the instrumentation class used to instrument the reception of messages.
</comment> <class> <name>DebugStepIntoBlockClosure</name> <environment>CraftedSmalltalk</environment> <super>Kernel.BlockClosure</super> <private>false</private> none <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DebugStepIntoBlockClosure
DebugStepIntoBlockClosure The DebugStepIntoBlockClosure is used by the debugger to step into a block closure. It is substituted for the block closures in the message send.
</comment> <class> <name>ProbedCompiledMethod</name> <environment>CraftedSmalltalk</environment> <super>Kernel.CompiledMethod</super> <private>false</private> objects original methodHolder probeStart removedProbedMethodsHolder <imports> OpcodePool.* </imports> <category>CraftedSt-VM</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbedCompiledMethod
An instance of ProbedCompiledMethod replaces a CompiledMethod when a probe is inserted. Instance Variables: original <CompiledMethod> The compiled method being replaced by the receiver. methodHolder <MethodNodeHolder> The MethodNodeHolder used to create the receiver. It is cached because the likelyhood of being needed again is high. probeStart <Integer> The starting index of the probes.
</comment> <class> <name>ProbedAnnotatedMethod</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.ProbedCompiledMethod</super> <private>false</private> objects attributes <imports></imports> <category>CraftedSt-VM</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbedAnnotatedMethod
ProbedAnnotatedMethod Version 1.0 Copyright 1995,1996 Crafted Smalltalk All Rights Reserved This class combines the functionality of the ProbedCompiledMethod class and the AnnotatedMethod class. Here is one place where multiple inheritance would be nice.
</comment> <class> <name>WatchWindowView</name> <environment>CraftedSmalltalk</environment> <super>UI.TextCollectorView</super> <private>false</private> none <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.WatchWindowView
WatchWindowHolder Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved WatchWindowView is a specialized TextCollectorView that handles being updated in a replace rather than log mode of operation.
</comment> <class> <name>PDPMthdListMsgRcvdInstrumenterGUIModel</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.PDPMsgRcvdInstrumenterGUIModel</super> <private>false</private> none origMethods <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <class> <name>CRC32Function</name> <environment>CraftedSmalltalk</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>CraftedSt-VM</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.CRC32Function
The CRC32Function provides a function to calculate 32 bit CRCs of a ByteArray. Shared Variables: CRC32Table <Array> Precalculated CRC table
</comment> <class> <name>PDPManager</name> <environment>CraftedSmalltalk</environment> <super>UI.ApplicationModel</super> <private>false</private> none watchWindows lastID methodDependents debugVariables defaultToPermanentProbe <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPManager
PDPManager Version 2.0 Copyright 1997, 2002 Crafted Smalltalk All Rights Reserved The PDPManager manages global functions related to the debug package.
</comment> <class> <name>ProbeCreationSpec</name> <environment>CraftedSmalltalk</environment> <super>Core.Object</super> <private>false</private> none probeClass conditional permanent selectWindowParams isAutoProbe <imports></imports> <category>CraftedSt-Tools support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeCreationSpec
ProbeCreationSpec Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved Instances of ProbeCreationSpec specify the type of probe to be created., Instance Variables: probeClass <Class> The class of the probe to create. conditional <Boolean> If true the probe will have a conditional expression. permanent <Boolean> If true the probe will be a permanent probe. selectWindowParams <Boolean> If true the select windows panel will be opened.
</comment> <class> <name>PDPTransientWarning</name> <environment>CraftedSmalltalk</environment> <super>UI.SimpleDialog</super> <private>false</private> none labelText <imports></imports> <category>CraftedSt-Tools support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPTransientWarning
PDPTransientWarning PDPTransientWarning opens a window that presents a short message and then closes automatically in 1.5 seconds. Instance Variables: labelText <Text> The message.
</comment> <class> <name>RawRemoteVariable</name> <environment>CraftedSmalltalk</environment> <super>Kernel.RemoteVariable</super> <private>false</private> none slot <imports></imports> <category>CraftedSt-Compiler</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.RawRemoteVariable
RawRemoteVariable Version 1.1 Copyright 1995,1997 Crafted Smalltalk All Rights Reserved Instances of RawRemoteVariable provide for accessing temporary variables of an outer context without forcing Context to create a local scope and checking variable names. The index of the variable is assumed to include compiler generated temps. This class was provided to improve accessing speed of the temps.
</comment> <class> <name>ProbeExprCompiler</name> <environment>CraftedSmalltalk</environment> <super>Kernel.Compiler</super> <private>false</private> none compileForProbes <imports></imports> <category>CraftedSt-Compiler</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeExprCompiler
ProbeExprCompiler Version 1.1 Copyright 1995,1998 Crafted Smalltalk All Rights Reserved Specializes the compiler to work with probed methods and probe expressions. Instance Variables: compileForProbes <Boolean> Instructs the compiler to force all blocks to be full blocks.
</comment> <class> <name>DisplayInstanceVarProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.DisplayVariableProbe</super> <private>false</private> none <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayInstanceVarProbe
DisplayInstanceVarProbe Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved When activated an instance of a DisplayInstanceVarProbe displays the contents of an instance variable.
</comment> <class> <name>BranchLimit</name> <environment>CraftedSmalltalk</environment> <super>Core.Error</super> <private>false</private> none <imports></imports> <category>CraftedSt-VM</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.BranchLimit
BranchLimit This exception is raised if inserting a probe into a method would cause a jump instruction to try to jump farther than the bytecode set permits.
</comment> <class> <name>PDPParser</name> <environment>CraftedSmalltalk</environment> <super>Kernel.Parser</super> <private>false</private> none <imports></imports> <category>CraftedSt-Compiler</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPParser
PDPParser Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved The PDPParser is used to create probe expressions. The expressions are compiled as special forms of doit expressions.
</comment> <class> <name>SilentProbeExprCompilerErrorHandler</name> <environment>CraftedSmalltalk</environment> <super>Kernel.CompilerErrorHandler</super> <private>false</private> none <imports></imports> <category>CraftedSt-Compiler</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.SilentProbeExprCompilerErrorHandler
SilentProbeExprCompilerErrorHandler Version 1.1 Copyright 1997,1998 Crafted Smalltalk All Rights Reserved This class is used to handle errors that may generated by the automatic compilation of probe expressions.
</comment> <class> <name>WatchWindowHolder</name> <environment>CraftedSmalltalk</environment> <super>UI.TextCollector</super> <private>false</private> none window label doLogging displayBox labelView <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.WatchWindowHolder
WatchWindowHolder Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved WatchWindowHolder is a specialized text collector for watch windows. It also holds additional information about the window that is reused after a window is closed then reopened Instance Variables: window <ScheduledWindow | nil> The watch window. label <String> The watch window label. doLogging <Boolean> Specifies whether logging or replacement is done. displayBox <Rectangle> The watch window display box. labelView <BorderedWrapper | nil> The watch window label view.
</comment> <class> <name>DisplayProbeEditor</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.CodeProbeEditor</super> <private>false</private> none <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayProbeEditor
DisplayProbeEditor Version 1.0 Copyright 1995,1996 Crafted Smalltalk All Rights Reserved An instance of DisplayProbeEditor is the model for a display probe editor panel. It serves two purposes; to build the panel, and to perform the appropriate action when the panel is closed.
</comment> <class> <name>TopOfStackVariable</name> <environment>CraftedSmalltalk</environment> <super>Kernel.VariableDefinition</super> <private>false</private> none <imports></imports> <category>CraftedSt-Compiler</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.TopOfStackVariable
TopOfStackVariable The TopOfStackVariable supports the TopOFStack pseudo variable in probe expressions. It provides the expression with access to the object on the top of the debugged context stack.
</comment> <class> <name>ProbeInsertionRecord</name> <environment>CraftedSmalltalk</environment> <super>Core.Object</super> <private>false</private> none pc blockIndex characterIndex mclass selector mapEntry atEnd bytesInBytecodes <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeInsertionRecord
Instances of ProbeInsertionRecord record where a probe is inserted. Instance Variables: pc <Integer> The probe insertion pc. blockIndex <Integer> The block index of the probe. characterIndex <Integer> The character index of the probe. mclass <Class> The class in which the ProbedCompiledMethod was compiled. selector <Symbol> The selector of the ProbedCompiledMethod. mapEntry <VisibleMapEntry> The map entry for the node in which the probe is inserted. atEnd <Boolean> True if the probe is inserted at the end of node bytesInBytecodes <Integer> How many bytes the probe had to add to the method's bytecodes in order to be invoked.
</comment> <class> <name>PDPIVarReferenceInstrumenter</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.PDPInstrumenter</super> <private>false</private> none actionString <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.PDPIVarReferenceInstrumenter
PDPIVarReferenceInstrumenter Version 1.0 Copyright 1997 Crafted Smalltalk All Rights Reserved The PDPIVarReferenceInstrumenter is the instrumentation class used to instrument the monitoring of instance variable references. Instance Variables: actionString <String> This string indicates what the variable reference is doing, reading or writing.
</comment> <class> <name>DisplayTOSProbe</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.DisplayProbe</super> <private>false</private> none <imports></imports> <category>CraftedSt-Probes</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.DisplayTOSProbe
DisplayTOSProbe Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved An instance of DisplayTOSProbe displays the top of the context stack when the probe is activated.
</comment> <class> <name>ProbedCompiledBlock</name> <environment>CraftedSmalltalk</environment> <super>Kernel.CompiledBlock</super> <private>false</private> objects probeStart <imports> OpcodePool.* </imports> <category>CraftedSt-VM</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbedCompiledBlock
Instances of ProbedCompiledBlock replace CompiledBlocks in a ProbedCompiledMethod. Instance Variables: probeStart <Integer> The starting index of the probes.
</comment> <class> <name>MethodActionRecord</name> <environment>CraftedSmalltalk</environment> <super>Core.Object</super> <private>false</private> none action class selector <imports></imports> <category>CraftedSt-Tools support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.MethodActionRecord
MethodActionRecord Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved Instances of MethodActionRecord are used by Browser's class probe panels to convey information to the methods inserting the probes into the selected methods. Instance Variables: action <Integer> class <Class> selector <Symbol>
</comment> <class> <name>ActionProbeEditor</name> <environment>CraftedSmalltalk</environment> <super>CraftedSmalltalk.DisplayProbeEditor</super> <private>false</private> none actionEditor <imports></imports> <category>CraftedSt-Tools</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ActionProbeEditor
ActionProbeEditor Version 1.1 Copyright 1995,1996,1997 Crafted Smalltalk All Rights Reserved An instance of ActionProbeEditor is the model for a display action probe editor panel. It serves two purposes; to build the panel, and to perform the appropriate action when the panel is closed. Instance Variables: actionEditor <ProbeExpressionEditor> The editor for the watch expression.
</comment> <class> <name>ProbeCharacterStyle</name> <environment>CraftedSmalltalk</environment> <super>Core.Association</super> <private>false</private> none <imports></imports> <category>CraftedSt-Tools support</category> <attributes> <package>Debugger-Probes</package> </attributes> </class> <comment> CraftedSmalltalk.ProbeCharacterStyle
ProbeCharacterStyle Version 1.0 Copyright 1995 Crafted Smalltalk All Rights Reserved The purpose of this class is to prevent the caching of character styles, actually associations, when used to retain probe information. The caching of styles began in VW 2.0 so this class is not needed for OW 4.1 and VW 1.0 but its use simplifies the overall code.
</comment> <name>PDPVersionNumber</name> <environment>CraftedSmalltalk</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>CRC32Table</name> <environment>CraftedSmalltalk.CRC32Function</environment> <private>false</private> <constant>false</constant> <category>table</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>ActionMethod</name> <environment>CraftedSmalltalk.DisplayActionProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>PrimeMap</name> <environment>CraftedSmalltalk.PDPWeakDictionary</environment> <private>false</private> <constant>false</constant> <category>vars</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>MaxMapped</name> <environment>CraftedSmalltalk.PDPWeakDictionary</environment> <private>false</private> <constant>false</constant> <category>vars</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>DoClone</name> <environment>CraftedSmalltalk.AbstractCodeProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>DefaultTestMethod</name> <environment>CraftedSmalltalk.CodeProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>DefaultTestSource</name> <environment>CraftedSmalltalk.CodeProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>TrueTestMethod</name> <environment>CraftedSmalltalk.CodeProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>FalseTestMethod</name> <environment>CraftedSmalltalk.CodeProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <name>DebugActiveMethod</name> <environment>CraftedSmalltalk.CodeProbe</environment> <private>false</private> <constant>false</constant> <category>defaults</category> <attributes> <package>Debugger-Probes</package> </attributes> <methods> CraftedSmalltalk.AbstractCodeProbe <category>comparing</category>
= aProbe ^[self baseParent == aProbe baseParent] on: MessageNotUnderstood do: [:ex | false]
basicHash ^super hash
hash ^self baseParent basicHash
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe <category>accessing</category>
baseParent parent == nil ifTrue: [^self]. ^parent baseParent
blockMethodIndex ^probeRecord blockMethodIndex
characterIndex ^probeRecord characterIndex
insertionPC ^probeRecord insertionPC
mclass ^probeRecord mclass
methodString ^probeRecord methodString
parent: aProbe parent := aProbe
probeRecord ^probeRecord
reinsertAfterLoadInto: aMethod probeRecord := aMethod probeRecordFor: probeRecord insertionRange. ^(self postLoadIntoMethod: aMethod) and: [aMethod addProbe: self. self recompileExpressionsUsingProbedMethod: aMethod].
reinsertInto: aMethod probeRecord := aMethod probeRecordFor: probeRecord insertionRange. aMethod addProbe: self.
selector ^probeRecord selector
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe <category>initialize-release</category>
forClass: aClass probeRecord isNil ifTrue: [probeRecord := ProbeInsertionRecord new mclass: aClass]
record: aProbeRecord probeRecord := aProbeRecord
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe <category>saving-loading</category>
loadFrom: aStream probeRecord := ProbeInsertionRecord createFrom: aStream.
postLoadIntoMethod: probedMethod "Ignore, return true" ^true
saveOn: aStream aStream nextPutAll: 'ProbeType: '; nextPutAll: self class shortName;cr. probeRecord saveOn: aStream.
storeOn: aStream "You really cannot restore a probe using #readFrom: so #storeOn: does not make sense, but the decompiler uses #storeOn: so we use this representation for the decompiler." aStream nextPutAll: '('; store: self class. aStream nextPutAll: ') '
unknowLoadField: someString on: aStream expected: fieldName self class unknowLoadField: someString on: aStream expected: fieldName
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe <category>expression compiling</category>
recompileExpressionsUsingProbedMethod: aMethod self subclassResponsibility
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe <category>copying</category>
basicMethodDcopyUsing: copyDict ^DoClone ifTrue: [ProbeClone parent: self] ifFalse: [(self basicDcopyUsing: copyDict) parent: self]
postDcopyUsing: copyDict probeRecord := probeRecord shallowCopy
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe class <category>compiler</category>
evaluatorClass ^ProbeExprCompiler "Smalltalk Professional Debug Package Version 1.6 (c) 1995,1998 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe class <category>class initialization</category>
initialize DoClone := false. "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe class <category>copy setup</category>
setClone DoClone := true "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
setCopy DoClone := false
</methods> <methods> CraftedSmalltalk.AbstractCodeProbe class <category>saving-loading</category>
unknowLoadField: someString on: aStream expected: fieldName Object errorSignal raiseErrorString: ((#UnknownField1sAtPosition2p3sExpected << #pdp >> 'Unknown field "<1s>" at position <2p>. "<3s>" was expected. Please correct the probe file.') expandMacrosWith: someString with: aStream position - someString size with: fieldName)
</methods> <methods> CraftedSmalltalk.ProbeClone <category>responses</category>
actOn: aContext ^parent actOn: aContext
</methods> <methods> CraftedSmalltalk.ProbeClone <category>editor creation</category>
createEditorOn: probedMethod ^parent createEditorOn: probedMethod
createEditorOn: probedMethod class: probedClass ^parent createEditorOn: probedMethod class: probedClass
modifyIn: aProbedMethod ^parent modifyIn: aProbedMethod
</methods> <methods> CraftedSmalltalk.ProbeClone <category>accessing</category>
emphasis ^parent emphasis value: self
emphasize: aText ^aText emphasizeFrom: parent characterIndex to: parent characterIndex with: self emphasis
</methods> <methods> CraftedSmalltalk.ProbeClone <category>testing</category>
isPermanent ^parent isPermanent
isTemporary ^parent isTemporary
</methods> <methods> CraftedSmalltalk.ProbeClone <category>initialize-release</category>
parent: aProbe parent := aProbe. probeRecord := parent probeRecord copy.
</methods> <methods> CraftedSmalltalk.ProbeClone <category>private</category>
test: aContext ^parent test: aContext
</methods> <methods> CraftedSmalltalk.ProbeClone class <category>instance creation</category>
parent: aProbe "Return a new instance of the receiver with aProbe as its parent." ^self new parent: aProbe "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPInstrumenterGUIModel <category>accessing</category>
basicTypeModel ^basicTypeModel
conditionalModel ^conditionalModel
ivarMenu ^ivarMenu
ivarMenuModel ^ivarMenuModel
listModel ^panelList
reportModel ^reportModel
selectedRecords ^panelList selectionIndexes collect: [:i | methods at: i].
subclassModel ^subclassModel
winParamModel ^winParam
</methods> <methods> CraftedSmalltalk.PDPInstrumenterGUIModel <category>private</category>
buildVariableMenu | index menu ivarSelection | (classUnderTest allInstVarNames includes: instrumenter iVarName) ifFalse: [instrumenter initializeIvar. ivarMenuModel changed: #value]. ivarSelection := instrumenter iVarSelection. menu := Menu labelArray: (Array with: ivarSelection key) lines: #(1) values: (Array with: ivarSelection). index := 0. classUnderTest withAllSuperclasses reverse do: [:cls | | clsIvarMenu ivars clsMenuItem | ivars := cls instVarNames. ivars isEmpty ifFalse: [clsIvarMenu := Menu labelArray: ivars values: (ivars collect: [:var | index := index + 1. var -> index]). clsMenuItem := MenuItem labeled: cls shortName. clsMenuItem labelText: cls shortName asText allItalic. clsMenuItem submenu: clsIvarMenu. menu addItem: clsMenuItem]]. ivarMenu value: menu
</methods> <methods> CraftedSmalltalk.PDPInstrumenterGUIModel <category>operation</category>
checkWinParamEnablement winParamButtonW isEnabled: self isWinParamButtonValid
finishUp | records | records := self selectedRecords. records isEmpty ifTrue: [^self closeRequest]. instrumenter class: classUnderTest. instrumenter useConditionalProbe: conditionalModel value; selectWindowParams: winParam value & self isWinParamButtonValid; instrumentationRecords: records. instrumenter instrumentationRequest: basicTypeModel value. self closeRequest. instrumenter initializeStartingScope. instrumenter initializeLabelStream. reportModel value ifTrue: [instrumenter report: basicTypeModel value]. instrumenter performInstrumentation.
isWinParamButtonValid ^conditionalModel value not and: [(basicTypeModel value == #instrumentSmartWatch or: [basicTypeModel value == #instrumentSimpleWatch])]
</methods> <methods> CraftedSmalltalk.PDPInstrumenterGUIModel <category>initialize-release</category>
on: aClass classUnderTest := aClass. self openInterface.
postBuildWith: aBuilder | mv | mv := (aBuilder componentAt: #ivarMenu) widget. mv vcBlock: [:obj :aMenu | mv makeTextLabelFor: obj asString asText allBold]. mv setLabel: instrumenter iVarName. winParamButtonW := aBuilder componentAt: #winParam. winParamButtonW isEnabled: winParam value.
preBuildWith: aBuilder subclassModel := ValueHolder with: true. conditionalModel := ValueHolder with: CodeProbe defaultConditionalProbe. "get default setting" winParam := ValueHolder with: CodeProbe defaultSelectWinParams. "get default setting" basicTypeModel := ValueHolder with: #instrumentBreakpoint. "get default setting" panelList := MultiSelectionInList new. reportModel := ValueHolder with: true. basicTypeModel onChangeSend: #checkWinParamEnablement to: self. conditionalModel onChangeSend: #checkWinParamEnablement to: self. subclassModel onChangeSend: #updateList to: self. ivarMenuModel := PluggableAdaptor on: '' asValue. ivarMenuModel getBlock: [:m | instrumenter iVarName] putBlock: [:m :v | instrumenter iVarName: v key. instrumenter iVarIndex: v value] updateBlock: [:m :p :a | false]. ivarMenu := nil asValue. self buildVariableMenu.
</methods> <methods> CraftedSmalltalk.PDPInstrumenterGUIModel class <category>instance creation</category>
instrumentIvarsIn: aClass PDPIVarRefInstrumenterGUIModel on: aClass "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
instrumentMsgRcvdIn: aClass PDPMsgRcvdInstrumenterGUIModel on: aClass "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
instrumentMsgRcvdOnList: aColl PDPMthdListMsgRcvdInstrumenterGUIModel on: aColl "Smalltalk Professional Debug Package Version 1.6 (c) 1998 Crafted Smalltalk"
on: aClass self new on: aClass "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenterGUIModel <category>operation</category>
checkIvarMenuButtonEnablement ivarMenuButton isEnabled: basicTypeModel value == #instrumentSimpleWatch.
help | msg | msg := Text string: (#ProbeOnMessageReceivedHelpText << #pdp >> 'The "Probe on message received" panel enables a user to insert a probe at the beginning of each method selected in the method list. The action performed by the probe is determined by the the type selection radio buttons. They are; Breakpoint Causes a breakpoint to occur when the message is received. Simple msg watch Records the receiver''s class and method selector in the watch window when the message is received. Ivar watch Causes a representation of the object in the instance variable to be recorded in the watch window. The representation is obtained by sending the object a "debugString" message. In Object, this method is defined as ^self printString. Expression watch Records the result of a user defined expression in the watch window. ---------------------- Other controls ------------------- Conditional This check box is selected, a probe editor will open after the Done button has been pressed. This allows the user to define an expression that will conditionally activate the probe. Likewise, the One should be aware that all the probes created by this panel will initially use this conditional expression. Later, if the conditional expression of a probe is modified, only that probe will receive the change. Window parameters This check box is used to request that a panel be opened to specify watch window parameters. Generate report This check box will cause a workspace to be opened containing a report of what instrumentation action was requested.') asString runs: (RunArray runs: #(234 10 63 16 103 10 239 16 131 11 65 4 347 17 96 15 118) values: #(nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil)). ComposedTextView open: msg asValue label: (#ProbeOnMessageReceivedHelp << #pdp >> 'Probe on Message Received Help') icon: (Icon constantNamed: #workspace) extent: (500 @ 300).
updateList | classes | classes := subclassModel value ifTrue: [classUnderTest withAllSubclasses] ifFalse: [Array with: classUnderTest]. methods := SortedCollection sortBlock: [:aa :b | aa nameString < b nameString]. classes do: [:cl | cl methodDictionary keysAndValuesDo: [:sel :meth | meth isProbeable ifTrue: [methods add: (MethodActionRecord action: nil class: cl selector: sel)]]]. panelList list: (methods collect: [:ac | ac nameString]).
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenterGUIModel <category>initialize-release</category>
postBuildWith: aBuilder super postBuildWith: aBuilder. ivarMenuButton := aBuilder componentAt: #ivarMenu. self updateList.
preBuildWith: aBuilder instrumenter := PDPMsgRcvdInstrumenter new. super preBuildWith: aBuilder. basicTypeModel onChangeSend: #checkIvarMenuButtonEnablement to: self.
</methods> <methods> CraftedSmalltalk.CodeProbe <category>responses</category>
actOn: aContext (self test: aContext) ifTrue: [^self breakOn: aContext label: self labelString].
</methods> <methods> CraftedSmalltalk.CodeProbe <category>accessing</category>
addVariable: aSymbol variables isNil ifTrue: [variables := Dictionary new]. ^variables at: aSymbol put: nil.
editorLabelString ^(#EditBreakpoint << #pdp >> 'Edit Breakpoint') asString
inspectString ^self labelString
labelString labelString value isNil ifTrue: [self createLabelString]. ^labelString value
labelString: aString labelString value: aString
reportString ^testMethod == FalseTestMethod ifTrue: [(#TestExprFailedRecompile << #pdp >> 'Test expression failed recompile (probe disabled)') asString] ifFalse: ['']
setTemporary permanent := false
testMethodAndSource ^testMethod -> testSource
testMethodAndSource: anAssoc testMethod := anAssoc key. testSource := anAssoc value string.
testSource testSource notNil ifTrue: [^testSource]. testMethod isNil ifTrue: [^String new]. ^testMethod getSource string
variableNames variables isNil ifTrue: [^#()]. ^variables keys asArray
variables variables isNil ifTrue: [^Dictionary new]. ^variables
workingCopy ^self shallowCopy postWorkingCopy
</methods> <methods> CraftedSmalltalk.CodeProbe <category>accessing - emphasis</category>
basicEmphasis ^ProbeCharacterStyle key: #probe value: self
emphasis ^permanent ifTrue: [self basicEmphasis] ifFalse: [self tempEmphasis]
emphasize: aText ^aText emphasizeFrom: self characterIndex to: self characterIndex with: self emphasis
tempEmphasis ^ProbeCharacterStyle key: #tempProbe value: self
</methods> <methods> CraftedSmalltalk.CodeProbe <category>private</category>
basicLabelString ^labelString value
basicTestMethod ^testMethod
basicTestSource ^testSource
test: aContext ^(self isPermanent or: [Processor activeProcess isUnderDebug]) and: [(testMethod isNil) or: [testMethod valueWithReceiver: aContext homeReceiver arguments: (Array with: aContext with: self)]]
</methods> <methods> CraftedSmalltalk.CodeProbe <category>initialize-release</category>
clearLabelString labelString value: nil.
createLabelString labelString value: ((#BreakIn1sAt2s << #pdp >> 'Break in <1s> at <2s>') expandMacrosWith: self methodString with: self characterIndex printString).
finishSetup (self mclass includesBehavior: Object) ifTrue: [^self]. self recompileIfKnownMethods.
ifNecessaryCopy: aMethod andRebindFrom: oldVariables "This method returns a new method with rebound variables if rebinding is needed. Otherwise, the original method is returned." | nuMethod keepCopy vars | variables == nil ifTrue: [^aMethod]. nuMethod := aMethod copy. keepCopy := false. vars := OrderedCollection new. oldVariables associationsDo: [:ac | vars add: ac]. nuMethod withAllBlockMethodsDo: [:meth | 1 to: meth numLiterals do: [:i | | lit | lit := meth at: i. (vars contains: [:obj | obj == lit]) ifTrue: [keepCopy := true. meth at: i put: (variables bindingFor: lit key)]]]. keepCopy ifFalse: [^aMethod]. ^nuMethod
initialize permanent := true. labelString := ValueHolder new.
postWorkingCopy variables := variables shallowCopy. labelString := labelString shallowCopy
recompileIfKnownMethods self isKnownMethod ifFalse: [^self]. testMethod := CodeProbe compileProbeMethod: testSource inClass: self mclass.
setAction testMethod := DefaultTestMethod. testSource := DefaultTestSource.
setAlwaysAction testMethod := TrueTestMethod. testSource := self class trueString.
setNoAction testMethod := FalseTestMethod. testSource := self class falseString.
updateExpressionsFromTemplate: aProbe | origMethod | testSource := aProbe basicTestSource. origMethod := aProbe basicTestMethod. testMethod := aProbe isKnownMethod ifTrue: [origMethod] ifFalse: [self ifNecessaryCopy: origMethod andRebindFrom: aProbe variables].
updateExpressionsFromWorkingCopy: aProbe self testMethodAndSource: aProbe testMethodAndSource.
updateFromTemplate: aProbe self updateMiscFromTemplate: aProbe. self updateExpressionsFromTemplate: aProbe.
updateFromWorkingCopy: aProbe self updateMiscFromWorkingCopy: aProbe. self updateExpressionsFromWorkingCopy: aProbe.
updateInstanceVarIndexForMethod: probedMethod "Ignore, return true" ^true
updateMiscFromProbe: aProbe probeRecord := aProbe probeRecord. self labelString: aProbe basicLabelString.
updateMiscFromTemplate: aProbe | nuVars | self updateMiscFromProbe: aProbe. variables == nil ifTrue: [^self]. nuVars := Dictionary new. variables keysAndValuesDo: [:aKey :aValue | nuVars at: aKey put: aValue]. variables := nuVars.
updateMiscFromWorkingCopy: aProbe self updateMiscFromProbe: aProbe. variables := aProbe variables. variables == nil ifTrue: [^self]. variables isEmpty ifTrue: [variables := nil].
updateTempVarForMethod: probedMethod "Ignore, return true" ^true
updateTempVarIndexForMethod: probedMethod "Ignore, return true" ^true
</methods> <methods> CraftedSmalltalk.CodeProbe <category>editor creation</category>
createEditorOn: probedMethod ^self createEditorOn: probedMethod class: probedMethod mclass
createEditorOn: probedMethod class: probedClass self forClass: probedClass. ^self createTestEditorOn: probedMethod class: probedClass
createTestEditorOn: probedMethod class: probedClass ^(CodeProbeEditor on: self in: probedMethod class: probedClass) createTestEditor
makeConditional: probeSpec replacing: unprobedMethod with: probedMethod probeSpec isConditional ifTrue: [self setNoAction. self finishSetup.] ifFalse: [self setAction. self finishSetup. unprobedMethod mclass addSelector: probedMethod selector withMethod: probedMethod. PDPManager changedMethodFrom: unprobedMethod to: probedMethod by: nil. ^self]. self openEditorOn: probedMethod andReplace: unprobedMethod
modifyIn: aProbedMethod | topView | topView := self createEditorOn: aProbedMethod. topView model closeAction: []. topView open
openEditorOn: probedMethod andReplace: unprobedMethod | topView | topView := self createEditorOn: probedMethod. topView model closeAction: [unprobedMethod mclass addSelector: probedMethod selector withMethod: probedMethod. PDPManager changedMethodFrom: unprobedMethod to: probedMethod by: nil]. topView open
unconditionallyInsertInto: probedMethod replacing: unprobedMethod self setAction. self finishSetup. unprobedMethod mclass addSelector: probedMethod selector withMethod: probedMethod. PDPManager changedMethodFrom: unprobedMethod to: probedMethod by: nil.
</methods> <methods> CraftedSmalltalk.CodeProbe <category>testing</category>
isKnownMethod ^testMethod == TrueTestMethod or: [testMethod == DebugActiveMethod or: [testSource = CodeProbe falseString]]
isPermanent ^permanent
isTemporary ^permanent not
</methods> <methods> CraftedSmalltalk.CodeProbe <category>saving-loading</category>
loadFrom: aStream super loadFrom: aStream. self loadLabelStringFrom: aStream. self loadVariablesFrom: aStream. self loadTestExpressionFrom: aStream.
loadLabelStringFrom: aStream | fieldName | fieldName := aStream upTo: Character space. fieldName = 'LabelString:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'LabelString:']. labelString := (String readFrom: aStream) asValue. aStream next. "swallow cr"
loadTestExpressionFrom: aStream | fieldName | fieldName := aStream upTo: Character space. fieldName = 'TestExpr:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'TestExpr:']. testSource := String readFrom: aStream. aStream next. "swallow cr"
loadVariablesFrom: aStream | fieldName numVars varName defaultVal | fieldName := aStream upTo: Character space. fieldName = 'Variables:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'Variables:']. numVars := Number readFrom: aStream. aStream next. "swallow cr" [numVars = 0] whileFalse: [varName := (aStream upTo: Character tab) asSymbol. self addVariable: varName. defaultVal := aStream nextChunk. aStream next. "swallow cr" defaultVal isEmpty ifFalse: [defaultVal := Compiler evaluate: defaultVal. self variableAt: varName put: defaultVal]. numVars := numVars - 1].
saveLabelStringOn: aStream aStream nextPutAll: 'LabelString: '. self labelString printOn: aStream. aStream cr.
saveOn: aStream super saveOn: aStream. self saveLabelStringOn: aStream. self saveVariablesOn: aStream. self saveTestExpressionOn: aStream.
saveTestExpressionOn: aStream aStream nextPutAll: 'TestExpr: '. self testSource printOn: aStream. aStream cr.
saveVariablesOn: aStream | varNames | aStream nextPutAll: 'Variables: '. varNames := self variableNames. varNames size printOn: aStream. aStream cr. varNames do: [:str | aStream nextPutAll: str; tab; nextPut: $!; cr.]
</methods> <methods> CraftedSmalltalk.CodeProbe <category>expression compiling</category>
makeSafeTestMethod testMethod := FalseTestMethod
recompileExpressionsUsingProbedMethod: aMethod ^self recompileTestExpressionUsingProbedMethod: aMethod
recompileTestExpressionUsingProbedMethod: aMethod | src meth | self isKnownMethod ifTrue: [^true]. src := self testSource. self makeSafeTestMethod. "Reset the method to a sane value in case of failure." meth := ProbeExprCompiler new compileProbeExpression: src forProbe: self inClass: aMethod mclass beginScope: (aMethod scopeForProbe: self) notifying: nil ifFail: [^false]. self testMethodAndSource: meth->src. ^true
</methods> <methods> CraftedSmalltalk.CodeProbe <category>public</category>
variableAt: aSymbol ^variables at: aSymbol
variableAt: aSymbol put: anObject ^variables at: aSymbol put: anObject
</methods> <methods> CraftedSmalltalk.CodeProbe class <category>class initialization</category>
compileProbeMethod: aString inClass: aClass | newMethod | newMethod := ProbeExprCompiler new compileProbeExpression: aString asString forProbe: self new inClass: aClass beginScope: (NameScope forClass: aClass) notifying: nil ifFail: [^nil]. newMethod isNil ifTrue: [^nil]. ^newMethod "Smalltalk Professional Debug Package Version 1.6 (c) 1995,1997,1998 Crafted Smalltalk"
debugActiveString ^'^DebugActive' "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
falseString ^'false' "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
initializeMethods DefaultTestMethod := DebugActiveMethod := self compileProbeMethod: self debugActiveString inClass: Object. DefaultTestSource := self debugActiveString. FalseTestMethod := self compileProbeMethod: self falseString inClass: Object. TrueTestMethod := self compileProbeMethod: self trueString inClass: Object. "Smalltalk Professional Debug Package Version 1.5 (c) 1995,1997 Crafted Smalltalk"
trueString ^'true' "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.CodeProbe class <category>instance creation</category>
createFrom: aStream | fieldName className | fieldName := aStream upTo: Character space. fieldName = 'ProbeType:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'ProbeType:']. className := (aStream upTo: Character cr) asSymbol. ^className asQualifiedReference value new loadFrom: aStream. "Smalltalk Professional Debug Package Version 2.51 (c) 2000 Crafted Smalltalk"
new ^super new initialize "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.CodeProbe class <category>defaults</category>
defaultConditionalProbe ^false "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
defaultProbeType ^#Breakpoint "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
defaultSelectWinParams ^false "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
defaultTempProbe ^PDPManager isPermanentProbeDefault not "Smalltalk Professional Debug Package Version 3.0 (c) 2001 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.CodeProbe class <category>testing</category>
needsSafeRebinding ^true
</methods> <methods> CraftedSmalltalk.CodeProbe class <category>user interaction</category>
newDefaultMethodFrom: aString inClass: aClass | dm | dm := self compileProbeMethod: aString inClass: aClass. dm isNil ifTrue: [^Dialog warn: (#MethodDidNotCompileDiscarded << #pdp >> 'Method did not compile,<n>change discarded.') expandMacros]. DefaultTestMethod := dm. DefaultTestSource := aString. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
selectBrowserProbeType ^self selectProbeType: false asTemp: false "Smalltalk Professional Debug Package Version 2.6 (c) 2001 Crafted Smalltalk"
selectDebuggerProbeTypeAsTemp: forceTemp ^self selectProbeType: true asTemp: forceTemp "Smalltalk Professional Debug Package Version 2.6 (c) 2001 Crafted Smalltalk"
selectProbeType: fromDebugger asTemp: forceTempProbe | panel buttonSpacing bottom aModel em col1Width col2Width col2Start totalWidth col1End basicTypeModel conditionalModel permanenceModel result winParam testBlock builder buttonSpec breakButtonW varWatchButtonW expWatchButtonW winParamButtonW condButtonW tempButtonW indent col2End extent yPosition acceptButtonW cancelButtonW tempProbe buttonWidth | conditionalModel := ValueHolder with: self defaultConditionalProbe. "get default setting" winParam := ValueHolder with: self defaultSelectWinParams. "get default setting" basicTypeModel := ValueHolder with: self defaultProbeType. "get default setting" tempProbe := forceTempProbe or: [self defaultTempProbe]. permanenceModel := ValueHolder with: tempProbe. panel := SimpleDialog new. builder := panel builder. builder add: (WindowSpec label: (#InsertProbe << #pdp >> 'Insert Probe')). em := 'm' asComposedText preferredBounds extent. buttonSpacing := (em y / 2) truncated. buttonSpec := RadioButtonSpec model: basicTypeModel label: (#Breakpoint << #pdp >> 'Breakpoint') select: #Breakpoint layout: (0@0 extent: 1@1). builder add: buttonSpec. breakButtonW := builder wrapper. buttonSpec := RadioButtonSpec model: basicTypeModel label: (#VariableWatch << #pdp >> 'Variable Watch') select: #Variable layout: (0@0 extent: 1@1). builder add: buttonSpec. varWatchButtonW := builder wrapper. buttonSpec := RadioButtonSpec model: basicTypeModel label: (#ExpressionWatch << #pdp >> 'Expression Watch') select: #Expression layout: (0@0 extent: 1@1). builder add: buttonSpec. expWatchButtonW := builder wrapper. col1Width := expWatchButtonW preferredBounds width. buttonSpec := CheckBoxSpec model: winParam label: (#WindowParameters << #pdp >> 'Window Parameters') layout: (0@0 extent: 1@1). builder add: buttonSpec. winParamButtonW := builder wrapper. winParamButtonW isEnabled: winParam value. col1Width := col1Width max: winParamButtonW preferredBounds width. buttonSpec := CheckBoxSpec model: conditionalModel label: (#Conditional << #pdp >> 'Conditional') layout: (0@0 extent: 1@1). builder add: buttonSpec. condButtonW := builder wrapper. col2Width := condButtonW preferredBounds width. fromDebugger ifTrue: [buttonSpec := CheckBoxSpec model: permanenceModel label: (#Temporary << #pdp >> 'Temporary') layout: (0@0 extent: 1@1). builder add: buttonSpec. tempButtonW := builder wrapper. tempButtonW isEnabled: forceTempProbe not. col2Width := col2Width max: tempButtonW preferredBounds width]. indent := em x * 2. col1End := col1Width + indent. col2Start := col1End + em x. col2End := col2Start + col2Width. totalWidth := col2End + indent. yPosition := em y. extent := breakButtonW preferredBounds extent. bottom := yPosition + extent y. breakButtonW newLayout: (LayoutFrame leftFraction: 0 offset: indent rightFraction: 0 offset: col1End topFraction: 0 offset: yPosition bottomFraction: 0 offset: bottom). extent := condButtonW preferredBounds extent. condButtonW newLayout: (LayoutFrame leftFraction: 0 offset: col2Start rightFraction: 0 offset: col2End topFraction: 0 offset: yPosition bottomFraction: 0 offset: yPosition + extent y). yPosition := bottom + buttonSpacing. extent := varWatchButtonW preferredBounds extent. bottom := yPosition + extent y. varWatchButtonW newLayout: (LayoutFrame leftFraction: 0 offset: indent rightFraction: 0 offset: col1End topFraction: 0 offset: yPosition bottomFraction: 0 offset: bottom). yPosition := bottom + buttonSpacing. extent := expWatchButtonW preferredBounds extent. bottom := yPosition + extent y. expWatchButtonW newLayout: (LayoutFrame leftFraction: 0 offset: indent rightFraction: 0 offset: col1End topFraction: 0 offset: yPosition bottomFraction: 0 offset: bottom). fromDebugger ifTrue: [extent := tempButtonW preferredBounds extent. tempButtonW newLayout: (LayoutFrame leftFraction: 0 offset: col2Start rightFraction: 0 offset: col2End topFraction: 0 offset: yPosition bottomFraction: 0 offset: yPosition + extent y)]. yPosition := bottom + buttonSpacing. extent := winParamButtonW preferredBounds extent. bottom := yPosition + extent y. winParamButtonW newLayout: (LayoutFrame leftFraction: 0 offset: indent rightFraction: 0 offset: col1End topFraction: 0 offset: yPosition bottomFraction: 0 offset: bottom). aModel := PluggableAdaptor on: (ValueHolder newBoolean). basicTypeModel addDependent: aModel. conditionalModel addDependent: aModel. testBlock := [basicTypeModel value == #Variable and: [conditionalModel value not]]. aModel getBlock: [:m | testBlock value] putBlock: [:m :v |] updateBlock: [:m :a :p | winParamButtonW isEnabled: testBlock value. true]. yPosition := bottom + (3 * buttonSpacing). "add okButton" buttonSpec := ActionButtonSpec model: #accept label: (#InsertDots << #pdp >> 'Insert...') layout: (0@0 extent: 1@1). builder add: buttonSpec. acceptButtonW := builder wrapper. "add cancel button" buttonSpec := ActionButtonSpec model: #cancel label: (#Cancel << #pdp >> 'Cancel') layout: (0@0 extent: 1@1). builder add: buttonSpec. cancelButtonW := builder wrapper. extent := cancelButtonW preferredBounds extent max: acceptButtonW preferredBounds extent. buttonWidth := extent x + (em x * 2). bottom := yPosition + extent y. cancelButtonW newLayout: (LayoutFrame leftFraction: 1 offset: indent negated - buttonWidth rightFraction: 1 offset: indent negated topFraction: 0 offset: yPosition bottomFraction: 0 offset: bottom). acceptButtonW newLayout: (LayoutFrame leftFraction: 1 offset: (indent negated - buttonWidth) * 2 rightFraction: 1 offset: indent negated * 2 - buttonWidth topFraction: 0 offset: yPosition bottomFraction: 0 offset: bottom). yPosition := buttonSpacing + bottom. builder window model: panel. panel accept onChangeSend: #close to: panel. panel cancel onChangeSend: #close to: panel. builder openDialogWithExtent: totalWidth @ yPosition. panel cancel value ifTrue: [^nil]. result := ProbeCreationSpec new probeClass: (basicTypeModel value); conditional: conditionalModel value. result selectWindowParams: winParam value & testBlock value. ^fromDebugger ifTrue: [result permanent: permanenceModel value not] ifFalse:[result] "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
setDefaultMethodToDebugActive DefaultTestMethod := DebugActiveMethod. DefaultTestSource := self debugActiveString. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
setDefaultMethodToFalse DefaultTestMethod := FalseTestMethod. DefaultTestSource := self falseString. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
setDefaultMethodToTrue DefaultTestMethod := TrueTestMethod. DefaultTestSource := self trueString. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.DisplayProbe <category>editor creation</category>
createDisplayEditorOn: probedMethod class: probedClass ^(DisplayProbeEditor on: self in: probedMethod class: probedClass) createEditor
createEditorOn: probedMethod class: probedClass self forClass: probedClass. ^self createDisplayEditorOn: probedMethod class: probedClass
makeConditional: probeSpec replacing: unprobedMethod with: probedMethod probeSpec isConditional ifTrue: [self setNoAction. self finishSetup.] ifFalse: [self setAction. probeSpec selectWindowParams ifTrue: [self openWindowParamSelector]. self finishSetup. unprobedMethod mclass addSelector: probedMethod selector withMethod: probedMethod. ^PDPManager changedMethodFrom: unprobedMethod to: probedMethod by: nil]. self openEditorOn: probedMethod andReplace: unprobedMethod
openWindowParamSelector ^(DisplayProbeEditor on: self in: nil class: nil) openWindowParamSelector
</methods> <methods> CraftedSmalltalk.DisplayProbe <category>initialize-release</category>
finishSetup super finishSetup. self setLabel
initialize super initialize. windowID := ''.
setLabel (PDPManager getWatchWindow: windowID for: self ) label: self labelString
updateMiscFromProbe: aProbe super updateMiscFromProbe: aProbe. windowID := aProbe windowID.
</methods> <methods> CraftedSmalltalk.DisplayProbe <category>saving-loading</category>
loadFrom: aStream super loadFrom: aStream. self loadWindowIDFrom: aStream.
loadWindowIDFrom: aStream | fieldName | fieldName := aStream upTo: Character space. fieldName = 'WindowID:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'WindowID:']. windowID := Object evaluatorClass evaluate: (aStream upTo: Character cr).
saveOn: aStream super saveOn: aStream. self saveWindowIDOn: aStream.
saveWindowIDOn: aStream aStream nextPutAll: 'WindowID: '. windowID printOn: aStream. aStream cr.
</methods> <methods> CraftedSmalltalk.DisplayProbe <category>accessing</category>
windowID ^windowID
windowID: anObject windowID := anObject.
</methods> <methods> CraftedSmalltalk.DisplayVariableProbe <category>saving-loading</category>
loadFrom: aStream super loadFrom: aStream. self loadVarNameFrom: aStream.
loadVarNameFrom: aStream | fieldName | fieldName := aStream upTo: Character space. fieldName = 'VariableName:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'VariableName:']. name := Object evaluatorClass evaluate: (aStream upTo: Character cr).
saveOn: aStream super saveOn: aStream. self saveVarNameOn: aStream.
saveVarNameOn: aStream aStream nextPutAll: 'VariableName: '. name printOn: aStream. aStream cr.
</methods> <methods> CraftedSmalltalk.DisplayVariableProbe <category>initialize-release</category>
name: aString index: anIndex name := aString. index := anIndex.
</methods> <methods> CraftedSmalltalk.DisplayVariableProbe <category>accessing</category>
reportString ^index = 0 ifTrue: [(#InvalidVarRefProbeRemoved << #pdp >> 'Invalid variable reference (probe removed)') asString] ifFalse: [super reportString]
variableIndex ^index
variableName ^name
</methods> <methods> CraftedSmalltalk.DisplayVariableProbe class <category>instance creation</category>
name: aString index: anIndex ^self new name: aString index: anIndex "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.DisplayMethodVarProbe <category>responses</category>
actOn: aContext (self test: aContext) ifTrue: [PDPManager display: (aContext getTempVar: slot) debugString on: windowID for: self]
</methods> <methods> CraftedSmalltalk.DisplayMethodVarProbe <category>initialize-release</category>
createLabelString labelString value: ((#MethodTemp1sIn2sAt3p << #pdp >> 'Method temp %<<1s>%> in <2s> at <3p>') expandMacrosWith: self variableName with: self methodString with: self characterIndex)
updateMiscFromProbe: aProbe super updateMiscFromProbe: aProbe. slot := aProbe slot. name := aProbe variableName.
updateTempVarForMethod: probedMethod "Update the receiver's slot for the named temporary variable. Return true if the tVar still exists, otherwise return false." slot := (probedMethod scopeForProbe: self) variableAt: name from: nil. ^slot notNil
</methods> <methods> CraftedSmalltalk.DisplayMethodVarProbe <category>accessing</category>
editorLabelString ^((#EditTempVarWatchOn1s << #pdp >> 'Edit Temporary Variable Watch on: %<<1s>%>') expandMacrosWith: name)
slot ^slot
slot: aSlot slot := aSlot value. name := aSlot key.
</methods> <methods> CraftedSmalltalk.DisplayMethodVarProbe <category>saving-loading</category>
postLoadIntoMethod: probedMethod ^self updateTempVarForMethod: probedMethod
</methods> <methods> CraftedSmalltalk.DisplayMethodVarProbe class <category>instance creation</category>
slot: aSlot ^self new slot: aSlot "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>text</category>
accept: aText from: aController ^self acceptText: aText from: aController.
text ^self subclassResponsibility
textAccepted: aController ^self acceptText: aController text from: aController
value ^self text
value: aText ^self acceptText: aText from: self textController.
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>private</category>
acceptText: aText from: aController | newMethod | newMethod := ProbeExprCompiler new compileProbeExpression: aText forProbe: probe inClass: probedClass beginScope: self scope notifying: aController ifFail: [^false]. newMethod == nil ifTrue: [^false]. self newMethodAndSource: newMethod->aText asString. self changed: #value. ^true
newMethodAndSource: anAssociation ^self subclassResponsibility
scope ^probedMethod isNil ifTrue: [NameScope forClass: probedClass] ifFalse: [probedMethod variableMapAt: probe blockMethodIndex]
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>menu messages</category>
addGlobalVariable | name | name := (Dialog request: (#EnterTheVariableNameC << #pdp >> 'Enter the variable name:')) asSymbol. (PDPManager debugVariables includesKey: name) ifTrue: [^Dialog warn: (#ThatVariableAreadyExists << #pdp >> 'That variable aready exists.')]. PDPManager addDebugVariable: name.
addLocalVariable | name | name := (Dialog request: (#EnterTheVariableNameC << #pdp >> 'Enter the variable name:')) asSymbol. (probe variables includes: name) ifTrue: [^Dialog warn: (#ThatVariableAreadyExists << #pdp >> 'That variable aready exists.')]. probe addVariable: name.
insertExpression: existingText from: aController | expressionNames newName expressionText | expressionNames := self class expressionNames asArray. expressionNames isEmpty ifTrue: [^Dialog warn: (#TheExpressionLibraryIsEmpty << #pdp >> 'The expression library is empty')]. newName := Dialog choose: (#SelectTheExpressionToInsertC << #pdp >> 'Select the expression to insert:') fromList: expressionNames values: expressionNames lines: 12 cancel: [^self]. expressionText := (self class atExpName: newName asSymbol) asText. aController replaceSelectionWith: expressionText
insertVariable: a from: aController | result | result := self variableMenu startUp. result = 0 ifTrue: [^self]. aController replaceSelectionWith: result asText.
inspectGlobalVariables PDPManager debugVariables isEmpty ifTrue: [^Dialog warn: (#NoVariablesToInspect << #pdp >> 'No variables to inspect')]. PDPManager debugVariables inspect
inspectLocalVariables probe variables isEmpty ifTrue: [^Dialog warn: (#NoVariablesToInspect << #pdp >> 'No variables to inspect')]. probe variables inspect
saveExpression: existingText from: aController | name textOrSelection | name := Dialog request: #EnterTheExpressionNameC << #pdp >> 'Enter the expression name:'. name isEmpty ifTrue: [^self]. (self class includesExpressionName: name) ifTrue: [(Dialog confirm: (#ExprExistsRedefineQ << #pdp >> 'That expression aready exists.<n>Do you wish to redefine it?') expandMacros initialAnswer: false) ifFalse: [^self]]. textOrSelection := aController hasRangeSelection ifTrue: [aController selection] ifFalse: [aController text]. self class atExpName: name put: textOrSelection asString
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>initialize-release</category>
buildTextMenu "Build the receiver's text menu." textMenu := Menu labelList: ParagraphEditor editGroupLabels, (OrderedCollection new add: (Array with: (#DoIt << #pdp >> 'Do it') with: (#PrintIt << #pdp >> 'Print it') with: (#InspectIt << #pdp >> 'Inspect it')); add: (Array with: (#Accept << #pdp >> 'Accept') with: (#Cancel << #pdp >> 'Cancel')); add: (Array with: (#InsertVar << #pdp >> 'Insert Var') with: (#DefineDebugVar << #pdp >> 'Define Debug Var') with: (#InspectDebugVars << #pdp >> 'Inspect Debug Vars') with: (#ResetMethod << #pdp >> 'Reset Method')); add: (Array with: (#InsertExpression << #pdp >> 'Insert Expression') with: (#SaveExpression << #pdp >> 'Save Expression')); add: (Array with: (#Hardcopy << #pdp >> 'Hardcopy')); asArray) values: ParagraphEditor editGroupSelectors , #(#doIt #printIt #inspectIt #accept:from: #cancel insertVariable:from:) , (Array with: (Menu labelArray: (Array with: (#Local << #pdp >> 'Local') with: (#Global << #pdp >> 'Global')) values: (Array with: [self addLocalVariable] with: [self addGlobalVariable]))) , (Array with: (Menu labelArray: (Array with: (#Local << #pdp >> 'Local') with: (#Global << #pdp >> 'Global')) values: (Array with: [self inspectLocalVariables] with: [self inspectGlobalVariables])) with: self resetMethodMenu) , #(insertExpression:from: #saveExpression:from: #hardcopy).
initialize super initialize. self buildTextMenu.
probe: aProbe on: aMethod class: aClass probedMethod := aMethod. probedClass := aClass. probe := aProbe.
resetMethodMenu self subclassResponsibility
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>evaluation</category>
doItReceiver ^probe
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>accessing</category>
editor ^self
nameScope ^NameScope forClass: probedClass
probe ^probe
probedClass ^probedClass
textController ^(builder componentAt: #textEditor) widget controller
turnOffAutoAccept self textController autoAccept: false.
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor <category>menus</category>
textMenu "Answer a Menu of operations on the source code that is to be displayed when the operate menu button is pressed." ^textMenu
variableMenu "Return a menu of all available variable references." | tnames inames dnames labels values | tnames := probedMethod isNil ifTrue: [#()] ifFalse: [(probedMethod variableMapAt: probe blockMethodIndex) tempNames reject: [:name | name first = $.]]. tnames := tnames asSet asSortedCollection. tnames := tnames , #('TopOFStack'). inames := self scope allInstVarNames. dnames := probe variableNames , PDPManager debugVariableNames. labels := #('Method Temp'). values := Array with: (Menu labelArray: tnames values: tnames). inames isEmpty ifFalse: [labels := labels , #('Instance'). values := values , (Array with: (Menu labelArray: inames values: inames))]. dnames isEmpty ifFalse: [labels := labels , #('Debug'). values := values , (Array with: (Menu labelArray: dnames values: dnames))]. ^Menu labelArray: labels values: values
</methods> <methods> CraftedSmalltalk.ProbeExpressionEditor class <category>expression library</category>
atExpName: aString ^expressionLibrary at: aString asSymbol
atExpName: aString put: anExpression ^expressionLibrary at: aString asSymbol put: anExpression
clearLibrary (Dialog confirm: (#ThisWillRemoveAllExprsContinueQ << #pdp >> 'This will remove all expressions from the library. Continue?')) ifFalse: [^self]. self initializeLibrary
expressionNames ^expressionLibrary keys
includesExpressionName: aString ^expressionLibrary includesKey: aString asSymbol "Smalltalk Professional Debug Package Version 1.51 (c) 1997 Crafted Smalltalk"
initializeLibrary expressionLibrary := Dictionary new
inspectLibrary expressionLibrary inspect
libraryFileComment self subclassResponsibility
readLibrary | string | string := Dialog requestFileName: (#EnterTheNameOfTheExpressionFile << #pdp >> 'Enter the name of the expression file') default: '' version: #mustBeOld. string isEmpty ifTrue: [^self]. self readLibraryFromFile: string asFilename
readLibraryFromFile: aFilename | strm | strm := aFilename readStream. [(Object readFrom: strm) associationsDo: [:ac | self atExpName: ac key put: ac value]] ensure: [strm close]
saveLibrary | string | string := Dialog requestFileName: (#EnterTheNameOfTheExpressionFile << #pdp >> 'Enter the name of the expression file') default: '' version: #new. string isEmpty ifTrue: [^self]. self saveLibraryToFile: string asFilename
saveLibraryToFile: aFilename | strm | strm := aFilename writeStream. [strm nextPutAll: self libraryFileComment. strm cr; cr. expressionLibrary storeOn: strm] ensure: [strm close]
</methods> <methods> CraftedSmalltalk.ProbeTestExpressionEditor <category>private</category>
newMethodAndSource: anAssociation probe testMethodAndSource: anAssociation.
</methods> <methods> CraftedSmalltalk.ProbeTestExpressionEditor <category>initialize-release</category>
resetMethodMenu ^Menu labelList: (Array with: (Array with: (#default << #pdp >> 'default') with: (#true << #pdp >> 'true') with: (#false << #pdp >> 'false'))) values: #(setTestMethodToDefault setTestMethodToTrue setTestMethodToFalse)
</methods> <methods> CraftedSmalltalk.ProbeTestExpressionEditor <category>menu messages</category>
setTestMethodToDefault probe setAction. self changed: #value.
setTestMethodToFalse probe setNoAction. self changed: #value.
setTestMethodToTrue probe setAlwaysAction. self changed: #value.
</methods> <methods> CraftedSmalltalk.ProbeTestExpressionEditor <category>text</category>
text ^probe testSource asText
</methods> <methods> CraftedSmalltalk.ProbeTestExpressionEditor class <category>expression library</category>
libraryFileComment ^(#TestExpressionLibraryFile << #pdp >> '"Test expression library file."') asString
</methods> <methods> CraftedSmalltalk.PDPIVarRefInstrumenterGUIModel <category>operation</category>
help | msg | msg := Text string: (#ProbeOnIvarRefHelpText << #pdp >> 'The "Probe on instance variable reference" panel enables a user to insert a probe where an instance variable is referenced in each selected method. Some of the probes send the "debugString" to the object on the Top of Stack. This object is either; the object just read from the variable, or the object to be written to the variable. The action performed by the probe is determined by the the type selection radio buttons. They are; Breakpoint Causes a breakpoint to occur at the variable reference point. Smart watch Records the following in the watch window; receiver''s class, method selector, character position of probe, the result of the "debugString" message being sent to the object on the Top of Stack in the watch window. One watch window is shared by all the probes. Simple watch Records the result of the "debugString message being sent to the object on the Top of Stack in the watch window. One watch window is shared by all the probes. N Simple watches Same as the Simple watch, except that each probe has its own watch window. Expression watch Records the result of a user defined expression in the watch window. This expression is initialized to "^TopOFStack debugString". ---------------------- Other controls ------------------- Conditional This check box is selected, a probe editor will open after the Done button has been pressed. This allows the user to define an expression that will conditionally activate the probe. Likewise, the One should be aware that all the probes created by this panel will initially use this conditional expression. Later, if the conditional expression of a probe is modified, only that probe will receive the change. Window parameters This check box is used to request that a panel be opened to specify watch window parameters. Generate report This check box will cause a workspace to be opened containing a report of what instrumentation action was requested.') asString runs: (RunArray runs: #(437 10 66 11 264 12 164 16 79 16 193 11 65 4 347 17 96 15 118) values: #(nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil)). ComposedTextView open: msg asValue label: (#ProbeOnIvarRefHelp << #pdp >> 'Probe on Instance Variable Reference Help') icon: (Icon constantNamed: #workspace) extent: (500 @ 300).
updateList | classes iVarIndex | iVarIndex := instrumenter iVarIndex. classes := subclassModel value ifTrue: [classUnderTest withAllSubclasses] ifFalse: [Array with: classUnderTest]. methods := SortedCollection sortBlock: [:aa :b | aa nameString < b nameString]. classes do: [:cl | cl methodDictionary keysAndValuesDo: [:sel :meth | | activity | activity := 0. (readModel value and: [meth readsField: iVarIndex]) ifTrue: [activity := 1]. (writeModel value and: [meth writesField: iVarIndex]) ifTrue: [activity := 3 - activity]. meth isProbeable ifFalse: [activity := 0]. activity ~= 0 ifTrue: [methods add: (MethodActionRecord action: activity class: cl selector: sel)]]]. panelList list: (methods collect: [:aRecord |aRecord printString]).
</methods> <methods> CraftedSmalltalk.PDPIVarRefInstrumenterGUIModel <category>initialize-release</category>
preBuildWith: aBuilder instrumenter := PDPIVarReferenceInstrumenter new. readModel := ValueHolder with: true. writeModel := ValueHolder with: true. readModel onChangeSend: #updateList to: self. writeModel onChangeSend: #updateList to: self. super preBuildWith: aBuilder. ivarMenuModel onChangeSend: #updateList to: self.
</methods> <methods> CraftedSmalltalk.PDPIVarRefInstrumenterGUIModel <category>accessing</category>
readModel ^readModel
writeModel ^writeModel
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser <category>private</category>
changedMethodList methodList list: (showHidden ifTrue: [hiddenMethods] ifFalse: [methods]).
changedSelection textHolder value: (selectedMethods size ~= 1 ifTrue: [Text new] ifFalse: [selectedMethods first sourceText])
clearMethods methods := self newMethodCollection.
menu ^selectedMethods isEmpty ifTrue: [showHidden ifTrue: [Menu labelArray: (Array with: #ShowNormal << #pdp >> 'Show Normal') values: #(showNormal)] ifFalse: [Menu labelArray: (Array with: (#ReinsertProbes << #pdp >> 'Reinsert Probes') with: (#ShowHidden << #pdp >> 'Show Hidden')) values: #(reinsertProbes showHidden)]] ifFalse: [showHidden ifTrue: [Menu labelArray: (Array with: (#ShowNormal << #pdp >> 'Show Normal') with: (#Unhide << #pdp >> 'Unhide')) values: #(showNormal unhide)] ifFalse: [Menu labelArray: (Array with: (#ReinsertProbes << #pdp >> 'Reinsert Probes') with: (#ShowHidden << #pdp >> 'Show Hidden') with: (#Hide << #pdp >> 'Hide')) values: #(reinsertProbes showHidden hide)]]
newMethodCollection ^SortedCollection sortBlock: [:a :b | a mclass name < b mclass name or: [a mclass name = b mclass name and: [a selector < b selector]]]
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser <category>menu commands</category>
hide hiddenMethods addAll: selectedMethods. methods removeAll: selectedMethods. selectedMethods := #(). self changedMethodList
reinsertProbes ProbedCompiledMethod recompileAndInsertProbesFrom: methods. hiddenMethods isEmpty ifTrue: [^builder window topComponent controller close]. self clearMethods. self changedMethodList.
showHidden showHidden := true. self changedMethodList
showNormal showHidden := false. self changedMethodList
unhide methods addAll: selectedMethods. hiddenMethods removeAll: selectedMethods. selectedMethods := #(). self changedMethodList
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser <category>initialize - release</category>
initialize self clearMethods. showHidden := false. selectedMethods := #(). hiddenMethods := self newMethodCollection. textHolder := '' asText asValue. methodList := MultiSelectionInList new. methodList selectionIndexHolder onChangeSend: #newSelection to: self. methodList selectionIndexHolder value: selectedMethods.
on: aCollection methods addAll: aCollection.
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser <category>accessing</category>
menuHolder ^[self menu]
methodList methodList list: (showHidden ifTrue: [hiddenMethods] ifFalse: [methods]). ^methodList
textHolder ^textHolder
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser <category>selecting</category>
newSelection selectedMethods := methodList selections. self changedSelection
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser class <category>interface opening</category>
onMethods: aCollection self openOn: (self new on: aCollection) "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>adding</category>
add: anAssociation "Include newObject as one of the receiver's elements. Answer newObject." self at: anAssociation key put: anAssociation value. ^anAssociation
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>initialize-release</category>
allWeak: size accessLock := RecursionLock new. valueArray := WeakArray new: size. valueArray addDependent: self. keyArray := WeakArray new: size. keyArray addDependent: self. tally := 0
normal: size accessLock := RecursionLock new. valueArray := Array new: size. keyArray := Array new: size. tally := 0
weakKeys: size accessLock := RecursionLock new. valueArray := Array new: size. keyArray := WeakArray new: size. keyArray addDependent: self. tally := 0
weakValues: size accessLock := RecursionLock new. valueArray := WeakArray new: size. valueArray addDependent: self. keyArray := Array new: size. tally := 0
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>accessing</category>
associationAt: key ifAbsent: aBlock "Answer an Association consisting of key and the value of the receiver at that key. If key is not found, evaluate aBlock." ^accessLock critical: [self unprotAssociationAt: key ifAbsent: aBlock]
at: key "Answer the value at key. If key is not found, raise a signal." ^self at: key ifAbsent: [self keyNotFoundError: key]
at: key ifAbsent: aBlock "Answer the value at key. If key is not found, answer the result of evaluating aBlock." ^accessLock critical: [self unprotAt: key ifAbsent: aBlock]
at: key put: anObject "Set the value at key to be anObject. If key is not found, create a new entry for key and set is value to anObject. Answer anObject." ^accessLock critical: [self unprotAt: key put: anObject]
capacity "Answer how much space the receiver has to contain elements." ^self collectionSize
keyAtValue: value ifAbsent: exceptionBlock "Answer the key whose value equals the argument, value. If there is none, answer the result of evaluating exceptionBlock." ^accessLock critical: [self unprotKeyAtValue: value ifAbsent: exceptionBlock]
size "Answer how many elements the receiver contains." ^tally
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>dictionary enumerating</category>
associationsDo: aBlock "Evaluate aBlock for associations consisting of the receiver's keys and their values." accessLock critical: [self unprotAssociationsDo: aBlock]
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>private - unprotected</category>
changeCapacityTo: newCapacity "Change the size of the receiver to newCapacity. -Note that #rehash uses this -- don't optimize the case where the receiver doesn't change in size." | newKeys newValues | newKeys := keyArray class new: newCapacity. newValues := valueArray class new: newCapacity. "Copy named instance variables." 1 to: newKeys class instSize do: [ :i | newKeys instVarAt: i put: (keyArray instVarAt: i)]. 1 to: newValues class instSize do: [ :i | newValues instVarAt: i put: (valueArray instVarAt: i)]. "Copy indexed variables" 1 to: keyArray size do: [:index | |key nuIndex probe| ((key := keyArray at: index) == nil or: [key = WeakArray tombstone]) "Keys cannot be nil or 0" ifFalse: [nuIndex := self initialIndexFor: key hash boundedBy: newCapacity. [(probe := newKeys at: nuIndex) == nil or: [probe == key]] whileFalse: [(nuIndex := nuIndex + 1) > newCapacity ifTrue: [nuIndex := 1]]. newKeys at: nuIndex put: key. newValues at: nuIndex put: (valueArray at: index)]]. valueArray := newValues. keyArray := newKeys.
finalize: array | deadIndex deadIndices| deadIndex := array size. deadIndices := OrderedCollection new. [deadIndex >= 1] whileTrue: [deadIndex := array indexOf: array tombstone replaceWith: nil startingAt: deadIndex stoppingAt: 1. deadIndex == 0 ifFalse: [deadIndices add: deadIndex. deadIndex := deadIndex - 1]]. self removeAndCleanUpIndices: deadIndices.
findKeyOrNil: key "Look for the key in the receiver. If it is found, answer the index of the association containting the key, otherwise answer the index of the first unused slot." | index length probe pass | length := keyArray size. pass := 1. index := self initialIndexFor: key identityHash boundedBy: length. [(probe := keyArray at: index) == nil or: [probe == key]] whileFalse: [(index := index + 1) > length ifTrue: [index := 1. pass := pass + 1. pass > 2 ifTrue: [^self grow findKeyOrNil: key]]]. ^index
rehash "Rebuild the receiver to insure that it is hashed correctly." "Note that this routine depends on implementors of #changeCapacityTo: not 'optimizing' the case where the receiver doesn't need to change." self changeCapacityTo: self capacity
removeAndCleanUpIndices: indices "Remove the keys in indices and rehash" indices do: [:index | keyArray at: index put: nil. valueArray at: index put: nil. tally := tally - 1]. self rehash
unprotAssociationAt: key ifAbsent: aBlock "Answer an Association consisting of key and the value of the receiver at that key. If key is not found, evaluate aBlock." | index storedKey | index := self findKeyOrNil: key. ^(storedKey := keyArray at: index) == nil ifTrue: [aBlock value] ifFalse: [Association key: storedKey value: (valueArray at: index)]
unprotAssociationsDo: aBlock "Evaluate aBlock for associations consisting of the receiver's keys and their values." 1 to: keyArray size do: [:index | (keyArray at: index) == nil ifFalse: [aBlock value: (Association key: (keyArray at: index) value: (valueArray at: index))]]
unprotAt: key ifAbsent: aBlock "Answer the value at key. If key is not found, answer the result of evaluating aBlock." | index | index := self findKeyOrNil: key. ^(keyArray at: index) == nil ifTrue: [aBlock value] ifFalse: [valueArray at: index]
unprotAt: key put: anObject "Set the value at key to be anObject. If key is not found, create a new entry for key and set is value to anObject. Answer anObject." | index | key == nil ifTrue: [^self subscriptBoundsError: key]. index := self findKeyOrNil: key. (keyArray at: index) == nil ifTrue: [tally := tally + 1. keyArray at: index put: key]. valueArray at: index put: anObject. self fullCheck. ^anObject
unprotDo: aBlock "Evaluate aBlock with each of the receiver's elements as the argument." 1 to: keyArray size do: [:index | (keyArray at: index) == nil ifFalse: [aBlock value: (valueArray at: index)]]
unprotIncludesKey: key "Answer whether the receiver has a key equal to the argument, key." | index | index := self findKeyOrNil: key. ^(keyArray at: index) notNil
unprotKeyAtValue: value ifAbsent: exceptionBlock "Answer the key whose value equals the argument, value. If there is none, answer the result of evaluating exceptionBlock." | theKey | 1 to: keyArray size do: [:index | value == (valueArray at: index) ifTrue: [(theKey := keyArray at: index) == nil ifFalse: [^theKey]]]. ^exceptionBlock value
unprotKeysAndValuesDo: aBlock "Evaluate aBlock with each of the receiver's key/value pairs as the arguments." 1 to: keyArray size do: [:index | | key | (key := keyArray at: index) == nil ifFalse: [aBlock value: key value: (valueArray at: index)]]
unprotRemoveKey: key ifAbsent: aBlock "Remove key from the receiver. If key is not in the receiver, answer the result of evaluating aBlock. Otherwise, answer the value associated with key." | index value | index := self findKeyOrNil: key. (keyArray at: index) == nil ifTrue: [^aBlock value]. value := valueArray at: index. self removeAndCleanUpIndices: (Array with: index). ^value
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>private</category>
collectionSize ^keyArray basicSize
fullCheck "If there is insufficient capacity in the receiver to do efficient lookups, then grow." "Require 25% free slots." keyArray size - self size <= (keyArray size // 4) ifTrue: [self grow]
grow "The receiver becomes roomier." self changeCapacityTo: self capacity + self growSize
initialIndexFor: aHashValue boundedBy: length "Find the place where we should start the search. Optimize for relatively small dictionaries." length > 1023 "maxHash will definitely be larger than this" ifTrue: [" For very large dictionaries, spread out the hash. " | maxHash | maxHash := ObjectMemory maximumIdentityHashValue. length > maxHash ifTrue: [^aHashValue * (length // maxHash + 1) \\ length + 1]]. ^aHashValue \\ length + 1
keyNotFoundError: key "Raise a signal indicating that the key was not found." ^Dictionary keyNotFoundSignal raiseWith: key
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>enumerating</category>
do: aBlock "Evaluate aBlock with each of the receiver's elements as the argument." accessLock critical: [self unprotDo: aBlock]
keysAndValuesDo: aBlock "Evaluate aBlock with each of the receiver's key/value pairs as the arguments." accessLock critical: [self unprotKeysAndValuesDo: aBlock]
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>dictionary testing</category>
includesKey: key "Answer whether the receiver has a key equal to the argument, key." ^accessLock critical: [self unprotIncludesKey: key]
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>dictionary removing</category>
remove: anObject ifAbsent: exceptionBlock "Provide an error notification that Dictionaries can not respond to remove: messages." self shouldNotImplement
removeKey: key ifAbsent: aBlock "Remove key from the receiver. If key is not in the receiver, answer the result of evaluating aBlock. Otherwise, answer the value associated with key." ^accessLock critical: [self unprotRemoveKey: key ifAbsent: aBlock]
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary <category>updating</category>
update: anAspectSymbol with: aParameter from: aSender anAspectSymbol == #ElementExpired ifFalse: [^self]. aSender == keyArray | (aSender == valueArray) ifFalse: [^self]. accessLock critical: [self finalize: aSender]
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary class <category>instance creation</category>
allWeak ^self allWeak: self createSize "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
allWeak: anInteger "Create an instance of a Set." anInteger >= 0 ifFalse: [self improperCreationSizeSignal raiseWith: anInteger]. ^super new allWeak: (self goodSizeFrom: anInteger) "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
new: anInteger "Create an instance of a Set." anInteger >= 0 ifFalse: [self improperCreationSizeSignal raiseWith: anInteger]. ^super new normal: (self goodSizeFrom: anInteger) "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
weakKeys ^self weakKeys: self createSize "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
weakKeys: anInteger "Create an instance of a Set." anInteger >= 0 ifFalse: [self improperCreationSizeSignal raiseWith: anInteger]. ^super new weakKeys: (self goodSizeFrom: anInteger) "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
weakValues ^self weakValues: self createSize "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
weakValues: anInteger "Create an instance of a Set." anInteger >= 0 ifFalse: [self improperCreationSizeSignal raiseWith: anInteger]. ^super new weakValues: (self goodSizeFrom: anInteger) "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary class <category>private</category>
createSize ^4 "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
goodSizeFrom: requestedSize "Given a size request, round it up to a size which will give best hash clustering (such as next prime)." "Just ensure oddness if out-of-range." ^(requestedSize <= 7 or: [requestedSize > ((PrimeMap size bitShift: 1) + 1)]) ifTrue: [requestedSize bitOr: 1] ifFalse: [(PrimeMap at: (requestedSize bitShift: -1)) + (requestedSize bitOr: 1)] "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPWeakDictionary class <category>class initialization</category>
improperCreationSizeSignal ^Set improperCreationSizeSignal "Smalltalk Professional Debug Package Version 2.5 (c) 1995,1999 Crafted Smalltalk"
initialize "Initialize signal and size table." "PDPWeakDictionary initialize" " the improperCreationSize signal has been delegated to 'Set improperCreationSizeSignal'." self makeSizeTable "Smalltalk Professional Debug Package Version 2.5 (c) 1995 - 1999 Crafted Smalltalk"
makeSizeTable "Construct a prefered size table mapping the first 1024 odd integers to the next prime." | primes pos sz | MaxMapped := 2049. primes := OrderedCollection with: 3. 3 to: MaxMapped + 100 "Slop to insure we get next prime over MaxMapped" by: 2 do: [:cand | primes detect: [:p | cand \\ p = 0] ifNone: [primes add: cand]]. primes := primes asArray. sz := MaxMapped // 2. PrimeMap := ByteArray new: sz. pos := 1. 1 to: sz do: [:i | | n p | n := i * 2 + 1. [(p := primes at: pos) >= n] whileFalse: [pos := pos + 1]. PrimeMap at: i put: p - n] "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.BreakInterrupt class <category>class initialization</category>
initialize notifierString := (#BreakDash << #pdp >> 'Break-').
</methods> <methods> CraftedSmalltalk.CodeProbeEditor <category>actions</category>
accept self install. self closeRequest
cancel self closeRequest.
</methods> <methods> CraftedSmalltalk.CodeProbeEditor <category>accessing</category>
closeAction: aBlock closeAction := aBlock
object: aProbe originalProbe := aProbe. ^workingCopyProbe := aProbe workingCopy.
testEditor testEditor == nil ifFalse: [^testEditor]. testEditor := ProbeTestExpressionEditor new probe: workingCopyProbe on: probedMethod class: probedClass. ^testEditor
</methods> <methods> CraftedSmalltalk.CodeProbeEditor <category>interface opening</category>
createEditor ^self createEditorOn: #testEditorSpec
createEditorOn: aSpec ^(self allButOpenInterface: aSpec) window
createTestEditor ^(self allButOpenInterface: #testEditorSpec) window
postBuildWith: aBuilder aBuilder window label: workingCopyProbe editorLabelString
</methods> <methods> CraftedSmalltalk.CodeProbeEditor <category>private</category>
install originalProbe updateFromWorkingCopy: workingCopyProbe. originalProbe finishSetup. closeAction value
</methods> <methods> CraftedSmalltalk.CodeProbeEditor <category>initialize-release</category>
on: aProbe in: aMethod class: aClass self object: aProbe. probedMethod := aMethod. probedClass := aClass
</methods> <methods> CraftedSmalltalk.CodeProbeEditor class <category>instance creation</category>
on: aProbe in: aMethod class: aClass ^self new on: aProbe in: aMethod class: aClass "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbeActionExpressionEditor <category>private</category>
newMethodAndSource: anAssociation probe actionMethodAndSource: anAssociation.
</methods> <methods> CraftedSmalltalk.ProbeActionExpressionEditor <category>menu messages</category>
resetMethod probe resetActionMethod. self changed: #value.
</methods> <methods> CraftedSmalltalk.ProbeActionExpressionEditor <category>initialize-release</category>
resetMethodMenu ^#resetMethod
</methods> <methods> CraftedSmalltalk.ProbeActionExpressionEditor <category>text</category>
text ^probe actionSource asText
</methods> <methods> CraftedSmalltalk.ProbeActionExpressionEditor class <category>expression library</category>
libraryFileComment ^(#WatchExpressionLibraryFile << #pdp >> '"Watch expression library file."') asString
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>opcodes-data movement</category>
dupFirst self push
dupLast self pop
dupNext "no action"
pop self pop: 1
push self push: 1
pushConstant: value self push
pushContext self push
pushCopiedValues: count self push: count
pushInst: index self push
pushLocal: index self push
pushLocalIndirect: majorIndex index: minorIndex self push.
pushNewArray: size self push
pushReceiver self push
pushStatic: assoc self push
storeInst: index "no action"
storeLocal: index "no action"
storePopInst: index self pop
storePopLocal: index self pop
storePopLocalIndirect: majorIndex index: minorIndex self pop.
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>private-jumps</category>
endBranch | state | (jumpStack isEmpty) ifTrue: [^pc := method bytesSize + 1]. state := jumpStack removeLast. pc := state key. depth := state value.
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>opcodes-control</category>
jump: delta delta < 0 ifFalse: [pc := pc + delta]
jump: delta if: condition self pop. jumpStack add: pc->depth. pc := pc + delta.
loopHead
makeCopyingBlock: meth count: count self pop: count - 1
makeFullBlock: meth self push
makeFullCopyingBlock: meth count: count self pop: count - 1
methodPrimitive: index self push
methodReturnTop: levels self endBranch
primitiveReturn
returnTop self endBranch
send: selector numArgs: na self pop: na
sendNoCheck: selector numArgs: na self pop: na
sendNonImmediate: selector numArgs: na self pop: na
sendSuper: selector numArgs: na self pop: na + 1
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>accessing</category>
maxDepth ^maxDepth
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>private-stack</category>
pop: count depth := depth - count
push: count depth := depth + count. maxDepth > depth ifFalse: [maxDepth := depth].
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>decoding</category>
depthAt: aPC [pc = aPC] whileFalse: [visited at: pc put: true. self interpretNextInstructionFor: self. (visited at: pc) ifTrue: [self endBranch]]. ^depth
run [self atEnd] whileFalse: [visited at: pc put: true. self interpretNextInstructionFor: self. (visited at: pc) ifTrue: [self endBranch]]
</methods> <methods> CraftedSmalltalk.AuxCodeInfoExtractor <category>private</category>
method: aMethod super method: aMethod. visited := Array new: method bytesSize + 1 withAll: false. jumpStack := OrderedCollection new. depth := method numTemps. maxDepth := depth.
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>accessing</category>
actionMethod ^actionMethod
actionMethodAndSource ^actionMethod -> actionSource
actionMethodAndSource: anAssoc actionMethod := anAssoc key. actionSource := anAssoc value string.
actionSource actionSource notNil ifTrue: [^actionSource]. actionMethod isNil ifTrue: [^String new]. ^actionMethod getSource string
basicActionMethod ^actionMethod
basicActionSource ^actionSource
compileExpression: aString inClass: aClass scope: aScope | aMethod | aMethod := ProbeExprCompiler new compileProbeExpression: aString forProbe: self inClass: aClass beginScope: aScope notifying: nil ifFail: [nil]. self actionMethodAndSource: aMethod -> aString
editorLabelString ^(#EditExpressionWatch << #pdp >> 'Edit Expression Watch') asString
reportString | str | ^(str := super reportString) isEmpty ifTrue: [(#ActionExprFailedRecompileDisabled << #pdp >> 'Action expression failed recompile (probe disabled)') asString] ifFalse: [actionMethod == ActionMethod ifTrue: [(#TestOrActionExprFailedRecompileDisabled << #pdp >> 'Test expression or action expression failed recompile (probed disabled)') asString] ifFalse: [str]]
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>responses</category>
actOn: aContext (self test: aContext) ifTrue: [PDPManager display: (actionMethod valueWithReceiver: aContext homeReceiver arguments: (Array with: aContext with: self)) on: windowID for: self]
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>editor creation</category>
createEditorOn: probedMethod class: probedClass self forClass: probedClass. ^(ActionProbeEditor on: self in: probedMethod class: probedClass) createEditor
makeConditional: probeSpec replacing: unprobedMethod with: probedMethod probeSpec isConditional ifTrue: [self setNoAction] ifFalse: [self setAction]. self finishSetup. self openEditorOn: probedMethod andReplace: unprobedMethod
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>initialize-release</category>
createLabelString labelString value: ((#ExpressionAt1pIn2s << #pdp >> 'Expression at <1p> in <2s>') expandMacrosWith: self characterIndex with: self methodString)
initialize super initialize. actionMethod := ActionMethod. actionSource := self class initialSource.
recompileIfKnownMethods super recompileIfKnownMethods. self isDefautActionMethod ifFalse: [^self]. actionMethod := CodeProbe compileProbeMethod: actionSource inClass: self mclass.
resetActionMethod actionMethod := ActionMethod. actionSource := self class initialSource.
updateExpressionsFromTemplate: aProbe super updateExpressionsFromTemplate: aProbe. actionSource := aProbe basicActionSource. actionMethod := self ifNecessaryCopy: aProbe basicActionMethod andRebindFrom: aProbe variables
updateExpressionsFromWorkingCopy: aProbe super updateExpressionsFromWorkingCopy: aProbe. self actionMethodAndSource: aProbe actionMethodAndSource.
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>testing</category>
isDefautActionMethod ^actionMethod == ActionMethod
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>saving-loading</category>
loadActionExpressionFrom: aStream | fieldName | fieldName := aStream upTo: Character space. fieldName = 'ActionExpr:' ifFalse: [^self unknowLoadField: fieldName on: aStream expected: 'ActionExpr:']. actionSource := String readFrom: aStream. aStream next. "swallow cr" actionMethod := nil.
loadFrom: aStream super loadFrom: aStream. self loadActionExpressionFrom: aStream.
saveActionExpressionOn: aStream aStream nextPutAll: 'ActionExpr: '. self actionSource printOn: aStream. aStream cr.
saveOn: aStream super saveOn: aStream. self saveActionExpressionOn: aStream.
</methods> <methods> CraftedSmalltalk.DisplayActionProbe <category>expression compiling</category>
recompileActionExpressionUsingProbedMethod: aMethod | src meth | self isDefautActionMethod ifTrue: [^true]. src := self actionSource. actionMethod := ActionMethod. "Reset the method to a sane value in case of failure." meth := ProbeExprCompiler new compileProbeExpression: src forProbe: self inClass: aMethod mclass beginScope: (aMethod scopeForProbe: self) notifying: nil ifFail: [^false]. self actionMethodAndSource: meth->src. ^true
recompileExpressionsUsingProbedMethod: aMethod ^(super recompileExpressionsUsingProbedMethod: aMethod) and: [self recompileActionExpressionUsingProbedMethod: aMethod]
</methods> <methods> CraftedSmalltalk.DisplayActionProbe class <category>initialization</category>
initializeMethods ActionMethod := self compileProbeMethod: self initialSource inClass: Object. "Smalltalk Professional Debug Package Version 1.5 (c) 1995,1997 Crafted Smalltalk"
initialSource ^'^''''' "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.DisplayActionProbe class <category>testing</category>
needsSafeRebinding ^true
</methods> <methods> CraftedSmalltalk.PDPWeakCollection <category>accessing</category>
add: anObject "Add anObject to the collection." accessLock critical: [| index | index := elements indexOf: nil replaceWith: anObject startingAt: 1 stoppingAt: elements size. index == 0 ifTrue: [index := elements size + 1. self basicGrow. elements at: index put: anObject]]. ^anObject
remove: anElement ifAbsent: aBlock "Remove anElement as one of the receiver's elements. If several of the elements are equal to anElement, only one is removed. If no element is equal to anElement, answer the result of evaluating anExceptionBlock. Otherwise, answer the argument, anElement." accessLock critical: [| index | index := elements indexOf: anElement replaceWith: nil startingAt: 1 stoppingAt: elements size. index == 0 ifTrue: aBlock]. ^anElement
</methods> <methods> CraftedSmalltalk.PDPWeakCollection <category>private - unprotected</category>
basicDo: aBlock 1 to: elements size do: [:i | | d | ((d := elements at: i) == nil or: [d == elements tombstone]) ifFalse: [aBlock value: d]].
basicGrow self resizeElements: elements size + self growSize
elementExpired "An element has expired. Shrink the element array if necessary." | size | elements nilAllCorpsesAndDo: [:a |]. size := elements size. "Don't shrink collection below minimum size." size > self minSize ifFalse: [^self]. "If the empty space is more than 80% of the available space then we should consider shrinking." self size > (size * 0.2) ifTrue: [^self]. self resizeElements: (self minSize max: (size / 2) truncated).
resizeElements: aSize "We compress by replacing the current elements WeakArray with a new compressed copy." | wa i | wa := WeakArray new: aSize. i := 0. self basicDo: [:ele | i := i + 1. wa at: i put: ele]. elements removeDependent: self. elements := wa. elements addDependent: self.
</methods> <methods> CraftedSmalltalk.PDPWeakCollection <category>enumerating</category>
do: aBlock "Evaluate aBlock with each of the receiver's elements as the argument." accessLock critical: [self basicDo: aBlock]
</methods> <methods> CraftedSmalltalk.PDPWeakCollection <category>private</category>
growSize "Return the size to increase the collection by when it becomes too small." ^10
minSize "Return the minimum collection size." ^6
</methods> <methods> CraftedSmalltalk.PDPWeakCollection <category>initialize-release</category>
initialize "Initialize the receiver." self initialize: self minSize.
initialize: aNumber "Initialize the receiver to provide aNumber of initially empty elements." accessLock := RecursionLock new. elements := WeakArray new: aNumber. elements addDependent: self.
</methods> <methods> CraftedSmalltalk.PDPWeakCollection <category>updating</category>
update: aSymbol with: aParameter from: anObject "Handle expiration notification." aSymbol == #ElementExpired & (anObject == elements) ifTrue: [^accessLock critical: [self elementExpired]].
</methods> <methods> CraftedSmalltalk.PDPWeakCollection class <category>instance creation</category>
new "Return an instance of this class with no empty space." ^super new initialize: 6 "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
new: aNumber "Return an instance of this class with aNumber of empty slots." ^super new initialize: aNumber "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>accessing</category>
class: aClass classUnderTest := aClass.
instrumentationRecords: aCollection instrumentationRecords := aCollection
instrumentationRequest: aSymbol instrumentationRequest := aSymbol.
iVarIndex ^iVarIndex
iVarIndex: anInteger iVarIndex := anInteger
iVarName ^iVarName
iVarName: aString iVarName := aString
iVarSelection ^iVarName -> iVarIndex
performInstrumentation self perform: instrumentationRequest.
selectWindowParams: aBoolean selectWindowParams := aBoolean
useConditionalProbe: aBoolean useConditionalProbe := aBoolean
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>private</category>
createAndAddProbesFor: aRec self subclassResponsibility
createExpression self subclassResponsibility
createIvarLeadString leadString := ((#Ivar1s << #pdp >> 'Ivar %<<1s>%> ') expandMacrosWith: iVarName).
createNewProbe probe := probeClass new. probe updateFromTemplate: templateProbe. probe record: probeRecord. probedMethod addProbe: probe.
createTemplateProbe templateProbe := probeClass new. self initializeTemplateTestMethod.
doNothing
finishBlock ^[| oldMethods newMethods | newMethods := ReadWriteStream on: (Array new: instrumentationRecords size). oldMethods := ReadWriteStream on: (Array new: instrumentationRecords size). instrumentationRecords do: [:aRec | | originalMethod | originalMethod := aRec compiledMethod. probedMethod := originalMethod newFullProbedMethod. probedMethod notNil ifTrue: [self createAndAddProbesFor: aRec. aRec replaceMethod: probedMethod. newMethods nextPut: probedMethod. oldMethods nextPut: originalMethod]]. oldMethods reset. newMethods reset. [newMethods atEnd] whileFalse: [PDPManager changedMethodFrom: oldMethods next to: newMethods next by: nil]]
initializeLabelStream labelStream := WriteStream on: (String new: 200).
initializeLabelstring self subclassResponsibility
initializeLabelstringToIvar templateProbe labelString: ((#x1sinClass2s << #pdp >> '<1s>in class <2s>') expandMacrosWith: leadString with: classUnderTest shortName).
initializeStartingScope startingScope := NameScope forClass: classUnderTest
initializeTemplateTestMethod useConditionalProbe ifTrue: [templateProbe setNoAction] ifFalse: [templateProbe setAction].
openEditor | topView | topView := templateProbe createEditorOn: nil class: classUnderTest. topView model closeAction: self finishBlock. topView open.
openEditor1 useConditionalProbe ifTrue: [self openEditor] ifFalse: [self finishBlock value].
openEditor2 | topView | useConditionalProbe ifTrue: [topView := templateProbe createDisplayEditorOn: nil class: classUnderTest. topView model closeAction: self finishBlock. topView open] ifFalse: [selectWindowParams ifTrue: [templateProbe openWindowParamSelector]. templateProbe forClass: classUnderTest. templateProbe finishSetup. self finishBlock value].
reportStringFor: aType ^self class reportStringFor: aType
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>expression watch</category>
createExpWatchLeadString self subclassResponsibility
initializeExpressionWatchProbeClass probeClass := DisplayActionProbe.
initializeExpWatchFinishSelector probeCompletionSelector := #doNothing
instrumentExpressionWatch self initializeExpressionWatchProbeClass. self initializeExpWatchFinishSelector. self createExpWatchLeadString. self createTemplateProbe. self initializeLabelstring. self createExpression. self openEditor.
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>simple watch</category>
createSimpleWatchTemplateProbe self subclassResponsibility
initializeSimpleWatchFinishSelector probeCompletionSelector := #doNothing
initializeSimpleWatchProbeClass probeClass := DisplayTOSProbe.
instrumentSimpleWatch self initializeSimpleWatchProbeClass. self initializeSimpleWatchFinishSelector. self createIvarLeadString. self createSimpleWatchTemplateProbe. self initializeLabelstringToIvar. self openEditor2
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>smart watch</category>
createSmartWatchLeadString self subclassResponsibility
initializeSmartWatchFinishSelector probeCompletionSelector := #createIndiviualProbeSmartExpression
initializeSmartWatchProbeClass probeClass := DisplayActionProbe.
instrumentSmartWatch self initializeSmartWatchProbeClass. self initializeSmartWatchFinishSelector. self createSmartWatchLeadString. self createTemplateProbe. self initializeLabelstring. self openEditor2
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>initialize-release</category>
initialize self initializeIvar.
initializeIvar iVarName := (#SelectVariable << #pdp >> 'Select Variable') asString. iVarIndex := 0.
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>breakpoints</category>
initializeBreakpointFinishSelector probeCompletionSelector := #createIndividualProbeLabel
initializeBreakpointLeadString self subclassResponsibility
initializeBreakpointProbeClass probeClass := CodeProbe.
instrumentBreakpoint self initializeBreakpointProbeClass. self initializeBreakpointFinishSelector. self initializeBreakpointLeadString. self createTemplateProbe. self openEditor1
</methods> <methods> CraftedSmalltalk.PDPInstrumenter <category>N simple watches</category>
initializeNSimpleWatchesFinishSelector probeCompletionSelector := #createIndividualProbeLabel
initializeNSimpleWatchesProbeClass probeClass := DisplayTOSProbe.
instrumentNSimpleWatches self initializeNSimpleWatchesProbeClass. self initializeNSimpleWatchesFinishSelector. self createIvarLeadString. self createTemplateProbe. self openEditor1
</methods> <methods> CraftedSmalltalk.PDPInstrumenter class <category>instance creation</category>
new ^super new initialize "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPInstrumenter class <category>reporting</category>
reportStringFor: aType ^reportStrings at: aType "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>private</category>
createAndAddProbesFor: aRec methodString := aRec nameString. probeRecord := probedMethod methodHolder node probeRecordAtStart. probeRecord getLastEntryFrom: probedMethod. self createNewProbe. self perform: probeCompletionSelector.
createContextExpression templateProbe compileExpression: ' ^DOITCONTEXT printString' inClass: classUnderTest scope: startingScope.
createExpression self createContextExpression.
initializeLabelstring templateProbe labelString: ((#MessagesReceivedInClass1s << #pdp >> 'Messages received in class <1s>') expandMacrosWith: classUnderTest shortName).
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>expression watch</category>
createExpWatchLeadString "ignore, don't need a lead string"
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>probe finish</category>
createIndividualProbeLabel labelStream reset. labelStream nextPutAll: leadString; nextPutAll: methodString. probe labelString: labelStream contents.
createIndiviualProbeSmartExpression probe compileExpression: ' ^''' , methodString , '''' inClass: classUnderTest scope: startingScope.
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>simple watch</category>
createSimpleWatchTemplateProbe templateProbe := DisplayInstanceVarProbe name: iVarName index: iVarIndex. self initializeTemplateTestMethod.
initializeSimpleWatchProbeClass probeClass := DisplayInstanceVarProbe.
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>smart watch</category>
createSmartWatchLeadString "ignore, don't need a lead string"
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>breakpoints</category>
initializeBreakpointLeadString leadString := (#BreakOnDash << #pdp >> 'Break on - ') asString.
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter <category>reporting</category>
report: basicType | reportStream | reportStream := WriteStream on: (String new: 200). reportStream nextPutAll: (self reportStringFor: basicType). instrumentationRequest == #instrumentSimpleWatch ifTrue: [reportStream nextPutAll: ' <'; nextPutAll: iVarName; nextPut: $>]. reportStream nextPutAll: (#OnMessageReceivedForC << #pdp >> ' on message received for:') asString; cr. instrumentationRecords do: [:rec | reportStream cr; nextPutAll: rec printString]. ComposedTextView open: reportStream contents asText asValue label: (#ProbeOnMessageReceivedReport << #pdp >> 'Probe on Message Received Report') icon: (Icon constantNamed: #workspace) extent: (500 @ 300).
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenter class <category>class initialization</category>
initialize reportStrings := Dictionary new. reportStrings at: #instrumentBreakpoint put: (#Breakpoint << #pdp >> 'Breakpoint') asString. reportStrings at: #instrumentSmartWatch put: (#SimpleMessageTrace << #pdp >> 'Simple message trace') asString. reportStrings at: #instrumentSimpleWatch put: (#InstanceVariableWatchpoint << #pdp >> 'Instance variable watchpoint') asString. reportStrings at: #instrumentExpressionWatch put: (#ExpressionWatchpoint << #pdp >> 'Expression watchpoint') asString. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.DebugStepIntoBlockClosure <category>evaluating</category>
value ^self valueWithArguments: #()
value: arg ^self valueWithArguments: (Array with: arg)
value: arg1 value: arg2 ^self valueWithArguments: (Array with: arg1 with: arg2)
value: arg1 value: arg2 value: arg3 ^self valueWithArguments: (Array with: arg1 with: arg2 with: arg3)
valueWithArguments: anArray "Override evaluation to raise a signal if the receiver is being evaluated in the context of the debugger's current debug process." Processor activeProcess isStepIntoBlock ifTrue: [BlockClosure adoptInstance: self. StepIntoBlockNotification raiseRequestWith: (thisContext blockContextFrom: self args: anArray)]. ^super valueWithArguments: anArray
</methods> <methods> CraftedSmalltalk.DebugStepIntoBlockClosure class <category>instance creation</category>
new "This class exists only for the use of the debugger." ^self shouldNotImplement
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>probe management</category>
addProbe: aProbe "Add aProbe to the receiver." (self blockAt: aProbe blockMethodIndex) basicAddProbe: aProbe
loadProbesFrom: aStream | fieldName numVars aProbe probesInError | fieldName := aStream upTo: Character space. fieldName = 'Probes:' ifFalse: [^AbstractCodeProbe unknowLoadField: fieldName on: aStream expected: 'Probes:']. probesInError := OrderedCollection new. numVars := Number readFrom: aStream. aStream next. "swallow cr" [numVars = 0] whileFalse: [aProbe := CodeProbe createFrom: aStream. (aProbe reinsertAfterLoadInto: self) ifFalse: [probesInError add: aProbe]. numVars := numVars - 1]. ^probesInError
recompileProbes | probesInError | probesInError := OrderedCollection new. self probesDo: [:aProbe | (aProbe recompileExpressionsUsingProbedMethod: self) ifFalse: [probesInError add: aProbe]]. ^probesInError
reinsertProbe: aProbe "This method is for reinserting probes into a method after loading from a file. DO NOT use when changing the method source code! Returns false if there is a problem with the probe, true otherwise." ^(aProbe updateInstanceVarIndexForMethod: self) and: [aProbe reinsertInto: self. aProbe recompileExpressionsUsingProbedMethod: self]
reinsertProbesFrom: origProbedMethod "This method is for reinserting probes into a method that has been recompiled because of a change in class definition. DO NOT use when changing the method source code!" | probesInError | probesInError := OrderedCollection new. origProbedMethod probesDo: [:aProbe | (self reinsertProbe: aProbe) ifFalse: [probesInError add: aProbe]]. ^probesInError
removeProbe: targetProbe "Remove aProbe from the receiver." (self blockAt: targetProbe blockMethodIndex) basicRemoveProbe: targetProbe.
saveOn: aStream | permProbes | permProbes := OrderedCollection new. self allProbesDo: [:aProbe | aProbe isPermanent ifTrue: [permProbes add: aProbe]]. permProbes isEmpty ifTrue: [^self]. self printNameOn: aStream inClass: mclass. aStream cr; nextPutAll: 'CRC: '. (CRC32Function crc32Of: (self getSource string asByteArrayEncoding: #UTF8)) printOn: aStream. aStream cr. aStream nextPutAll: 'Probes: '. permProbes size printOn: aStream. aStream cr. permProbes do: [:aProbe | aProbe saveOn: aStream].
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>accessing - probes</category>
allProbesDo: aBlock self withAllProbedBlockMethodsDo: [:pBlock | pBlock probesDo: aBlock]
includesProbe: targetProbe "Return true if the receiver contains targetProbe." ^(self blockAt: targetProbe blockMethodIndex) basicIncludesProbe: targetProbe.
jumpRecordFor: selectionRange blkIndex: blkIndex "Get the probe record corresponding to selectionRange." ^methodHolder node jumpRecordFor: selectionRange blkIndex: blkIndex
probeRecordFor: selectionRange "Get the probe record corresponding to selectionRange." ^methodHolder node probeRecordFor: selectionRange
probesDo: aBlock probeStart to: self size do: [:i | | aProbe | aProbe := self basicAt: i. aProbe == nil ifFalse: [aBlock value: aProbe]]
scopeForProbe: aProbe ^self variableMapAt: aProbe blockMethodIndex
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>private - probes</category>
addProbeToLiterals: aProbe | probeIndex | [probeIndex := (probeStart to: self size) detect: [:i | (self basicAt: i) == nil] ifNone: [nil]. probeIndex == nil] whileTrue: [self grow]. self basicAt: probeIndex put: aProbe. ^probeIndex
basicAddProbe: aProbe "Add aProbe to the receiver." | probeIndex | probeIndex := self addProbeToLiterals: aProbe. (self insertProbeBytecodesFor: probeIndex) ifTrue: [^self]. "A method branch limit was exceeded." BranchLimit raiseSignal.
basicHasAnyProbes ^(probeStart to: self size) anySatisfy: [:i | (self basicAt: i) notNil]
basicIncludesProbe: targetProbe | probeIndex aProbe | probeIndex := probeStart. [aProbe := self basicAt: probeIndex. targetProbe = aProbe or: [probeIndex = self size]] whileFalse: [probeIndex := probeIndex + 1]. ^targetProbe = aProbe
basicRemoveProbe: aProbe "Add aProbe to the receiver." | probeIndex someProbe probeRecord pc newBytes segments | probeIndex := probeStart. [someProbe := self basicAt: probeIndex. aProbe = someProbe] whileFalse: [probeIndex := probeIndex + 1]. probeRecord := (self basicAt: probeIndex) probeRecord. self basicAt: probeIndex put: nil. "Make position empty." pc := probeRecord insertionPC. segments := JumpDecomposer new forMethod: self. self sourceMap do: [:me | me registerPCsWith: segments]. self probesDo: [:prb | prb probeRecord registerPCsWith: segments]. segments := segments decompose. segments do: [:seg | (pc between: seg oldBasePC and: seg oldBasePC+seg bytes size) ifTrue: [seg removeBytesAt: pc+1-seg oldBasePC size: probeRecord bytesInBytecodes segments: segments]]. newBytes := segments first class composeSegments: segments. bytes := (ByteArray new: newBytes size + 4) replaceFrom: 1 to: 4 with: bytes startingAt: 1. bytes replaceFrom: 5 to: bytes size with: newBytes startingAt: 1. bytes at: 4 put: (AuxCodeInfoExtractor new method: self; run; maxDepth).
insertProbeBytecodesFor: probeIndex | newBytes probeRecord pc fragment segments | probeRecord := (self basicAt: probeIndex) probeRecord. pc := probeRecord insertionPCFor: self. fragment := AssemblerCodeStream new initializeLiteralsFrom: self; pushConstant: (self basicAt: probeIndex); pushContext; sendNoCheck: #actOn: numArgs: 1; pop; bytes. segments := JumpDecomposer new forMethod: self. self sourceMap do: [:me | me registerPCsWith: segments]. self probesDo: [:aProbe | aProbe probeRecord registerPCsWith: segments]. segments := segments decompose. segments do: [:seg | (pc between: seg oldBasePC and: seg oldBasePC+seg bytes size) ifTrue: [seg insertBytesAt: pc+1-seg oldBasePC bytes: fragment for: probeRecord segments: segments]]. newBytes := [segments first class composeSegments: segments] on: ByteCodeStream branchLimitSignal do: [:x | ^false]. probeRecord bytesInBytecodes: fragment size. bytes := (ByteArray new: newBytes size + 4) replaceFrom: 1 to: 4 with: bytes startingAt: 1. bytes replaceFrom: 5 to: bytes size with: newBytes startingAt: 1. bytes at: 4 put: (AuxCodeInfoExtractor new method: self; run; maxDepth). ^true
probeSize | count | count := 0. probeStart to: self basicSize do: [:i | (self basicAt: i) isNil ifFalse: [count := count + 1]]. ^count
totalProbes | total | total := 0. self withAllProbedBlockMethodsDo: [:aBlock | total := aBlock probeSize + total]. ^total
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>accessing</category>
collectReferencesTo: variable ^methodHolder node collectReferencesTo: variable
installedMethod ^mclass compiledMethodAt: self selector ifAbsent: [nil].
methodHolder ^methodHolder
newFullProbedMethod ^self dcopy
newNormalProbedMethod ^self dcopy
newTempFullProbedMethod ^self newTempProbedMethod
newTempProbedMethod | nuMethod | AbstractCodeProbe setClone. nuMethod := self dcopy. nuMethod originalMethod: self. AbstractCodeProbe setCopy. ^nuMethod
originalMethod ^original originalMethod
originalMethod: aMethod original := aMethod
permanentMethod ^original
selector ^methodHolder selector
sourceInfoIfCached ^methodHolder
sourceMap ^methodHolder sourceMap at: 1
sourceMapAt: index ^methodHolder sourceMap at: index
variableMap ^methodHolder variableMap at: 1
variableMapAt: index ^methodHolder variableMap at: index
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>copying</category>
copy ^self class registerMethod: super copy.
dcopy ^self class registerMethod: super dcopy.
postDcopyUsing: copyDict methodHolder := methodHolder basicDcopyUsing: copyDict. 1 to: self basicSize do: [ :i | self basicAt: i put: ((self basicAt: i) basicMethodDcopyUsing: copyDict)]
shallowCopy ^self class registerMethod: super shallowCopy.
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>initialize-release</category>
copyFrom: oldSelf 1 to: oldSelf basicSize do: [ :i | self basicAt: i put: (oldSelf basicAt: i)]. 1 to: self class instSize do: [ :i | self instVarAt: i put: (oldSelf instVarAt: i)].
from: aCompiledMethod full: fullFlag | adjustedMethod compiler | original := aCompiledMethod. mclass := aCompiledMethod mclass. sourceCode := aCompiledMethod sourcePointer. (mclass compilerClass == Compiler or: [(mclass compilerClass respondsTo: #treatsAsSimpleSmalltalk:) and: [mclass compilerClass treatsAsSimpleSmalltalk: self getSource]]) ifFalse: [^self error: (#CannotInsertIncompatibleCompiler << #pdp >> ' Cannot insert probe, selected class uses incompatible compiler.')]. compiler := ProbeExprCompiler new. fullFlag ifTrue: [compiler setCompileForProbes]. methodHolder := compiler parse: aCompiledMethod getSource in: mclass environment: aCompiledMethod environment allowReceiver: true noPattern: aCompiledMethod usuallyHasSelector not notifying: nil. adjustedMethod := methodHolder generate. probeStart := adjustedMethod numLiterals + 2. self at: probeStart - 1 put: #actOn:. 1 to: adjustedMethod numLiterals do: [:i | | lit cl bm | lit := adjustedMethod literalAt: i. cl := lit class. cl == CompiledBlock ifTrue: [self literalAt: i put: (lit := ProbedCompiledBlock from: lit). lit outerMethod: self] ifFalse: [cl == BlockClosure ifTrue: [self literalAt: i put: (lit := lit copy). bm := ProbedCompiledBlock from: lit method. lit method: bm. bm outerMethod: self] ifFalse: [self literalAt: i put: lit]]]. self initializeBytes. ^self
grow | newSelf | newSelf := self class new: self basicSize + 7. newSelf copyFrom: self. newSelf become: self
install self noNotifyInstall. PDPManager changedMethodFrom: original to: self by: nil.
noNotifyInstall mclass addSelector: self selector withMethod: self.
revert "Restore the original method. Returns true if successful, otherwise false." self installedMethod == self ifFalse: [^false]. mclass addSelector: self selector withMethod: original. PDPManager changedMethodFrom: original to: self by: nil. ^true
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>testing</category>
hasAnyProbes self withAllProbedBlockMethodsDo: [:aBlock | aBlock basicHasAnyProbes ifTrue: [^true]]. ^false
isInSystem ^mclass notNil and: [self installedMethod == self]
isPartiallyBound ^self installedMethod originalMethod == self originalMethod
isProbed ^true
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>source code management</category>
highlightProbesIn: sourceText "Return sourceText with probe locations emphasized." self allProbesDo: [:aProbe | aProbe emphasize: sourceText]. ^sourceText
sourceText ^self highlightProbesIn: (self getSource asText makeSelectorBoldIn: mclass)
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>printing</category>
printNameOn: aStream inClass: aClass | selector class | aClass isNil ifTrue: [| who | mclass isNil ifTrue: [aStream nextPutAll: (#ParenUnboundMethodParen << #pdp >> '(Unbound method)') asString. ^self]. who := self who. who isNil ifTrue: [class := mclass. selector := class defaultSelectorForMethod: self] ifFalse: [class := who first. selector := who at: 2]] ifFalse: [class := aClass. selector := self selector]. aStream nextPutAll: class shortName. mclass == class ifFalse: [aStream nextPut: $(. aStream nextPutAll: mclass shortName. aStream nextPut: $)]. aStream nextPutAll: '>>'. aStream nextPutAll: selector
who "Answer an Array of the class in which the receiver is defined and the selector to which it corresponds. If the receiver is not defined in any class, answer nil." mclass isNil ifTrue: [^nil]. ^Array with: mclass with: self selector
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>fileIn/Out</category>
representBinaryOn: bosWriter " The stored representation of CompiledMethods is special. Overriding this method helps prevent bossing out of probed methods. " ^bosWriter representCompiledMethod: original
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>tracing</category>
traceFrom: aTracer self error: (#ParcellingOutAProbedMethodErrorMessage << #pdp >> ' An attempt was made to parcel out a ProbedCompiledMethod. You must remove the probes from the target methods before parceling them out.')
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod <category>private - bytes</category>
initializeBytes | adjustedMethod flags | adjustedMethod := methodHolder generate. flags := 16rC0 + (adjustedMethod usesContextInstVars ifTrue: [16] ifFalse: [0]). bytes := (ByteArray with: flags with: original numArgs with: adjustedMethod numTempsOnly with: adjustedMethod frameSize) , adjustedMethod bytes.
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod class <category>utilities</category>
allInstalledProbedMethods ^(self allProbedMethods select: [:meth | meth isInSystem]) asArray
allProbedMethods ^self allInstances asOrderedCollection addAll: (ProbedAnnotatedMethod allInstances);yourself
readProbesFromFile | fileName libStream | fileName := Dialog requestFileName: (#NameOfProbeLibrary << #pdp >> 'Name of probe library') default: '*.prb' version: #mustBeOld. fileName isEmpty ifTrue: [^self]. libStream := fileName asFilename readStream. [self probeMethodsFrom: libStream] ensure: [libStream close] "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
registerMethod: aMethod ^aMethod
revertAllProbedMethodsInSystem self allInstalledProbedMethods do: [:each | each revert]
saveProbesToFile | fileName libStream | fileName := Dialog requestNewFileName: (#NameOfProbeLibrary << #pdp >> 'Name of probe library') default: '*.prb'. fileName isEmpty ifTrue: [^self]. libStream := fileName asFilename writeStream. [self allInstalledProbedMethods do: [:pMeth | pMeth saveOn: libStream]] ensure: [libStream close] "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod class <category>recompiling</category>
dontKeepRemovedMethods removedProbedMethodsHolder := PluggableAdaptor on: ValueHolder new. removedProbedMethodsHolder getBlock: [:m | Array new] putBlock: [:m :v | v] updateBlock: [:m :a :p | false] "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
keepRemovedMethods removedProbedMethodsHolder := PluggableAdaptor on: (ValueHolder with: OrderedCollection new). removedProbedMethodsHolder getBlock: [:m | m value] putBlock: [:m :v | m value addAll: v] updateBlock: [:m :a :p | false] "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
recompileAndInsertProbesFrom: probedMethods | probesInError | probesInError := OrderedCollection new. probedMethods do: [:meth | | newProbedMethod | newProbedMethod := meth installedMethod newFullProbedMethod. probesInError addAll: (newProbedMethod reinsertProbesFrom: meth). newProbedMethod hasAnyProbes ifTrue: [newProbedMethod install]]. self reportOnFailedProbes: probesInError. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
removedMethods ^removedProbedMethodsHolder value "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
removedMethods: methods ^removedProbedMethodsHolder value: methods "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
reportOnFailedProbes: probesInError | writeStream | probesInError isEmpty ifTrue: [^self]. writeStream := WriteStream on: (String new: 200). writeStream nextPutAll: (#TheFollowingProbesFailedToRecompile << #pdp >> 'The following probes failed to recompile correctly. ') asString. probesInError do: [:aProbe | writeStream nextPutAll: aProbe methodString; nextPutAll: ((#SpProbeAt1pDash2s << #pdp >> ' probe at <1p> - <2s><n>') expandMacrosWith: aProbe characterIndex printString with: aProbe reportString)]. [ComposedTextView open: writeStream contents asText asValue label: (#FailedProbeRecompileReport << #pdp >> 'Failed probe recompile report')] fork "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod class <category>instance creation</category>
from: aCompiledMethod full: fullFlag ^(self new: aCompiledMethod basicSize + 7) from: aCompiledMethod full: fullFlag "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
probeMethodsFrom: aStream | aClassName selector meth cls | [aStream atEnd] whileFalse: [aClassName := aStream upTo: $>. aStream next == $> ifFalse: [^Dialog warn: (#CannotUnderstandClassselector << #pdp >> 'Cannot understand class>>selector')]. selector := aStream upTo: Character cr. cls := Compiler evaluate: aClassName. cls isNil ifTrue: [^Dialog warn: ((#BadClassNameC1s << #pdp >> 'Bad class name: <1s>') expandMacrosWith: aClassName)]. meth := cls compiledMethodAt: selector asSymbol ifAbsent: [^Dialog warn: ((#x1sDoesNotHaveMethod2s << #pdp >> '<1s> does not have method #<2s>') expandMacrosWith: aClassName with: selector)]. (self readMethodCRCFrom: aStream) = (CRC32Function crc32Of: (meth getSource string asByteArrayEncoding: #UTF8)) ifFalse: [^Object errorSignal raiseErrorString: (#CannotInsertProbesMethodChanged << #pdp >> 'Cannot insert probes, method has changed.')]. meth isProbed ifFalse: [meth := meth newFullProbedMethod. meth loadProbesFrom: aStream. meth install]] "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod class <category>class initialization</category>
initialize self dontKeepRemovedMethods. "Smalltalk Professional Debug Package Version 3.1 (c) 2002 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbedCompiledMethod class <category>private</category>
readMethodCRCFrom: aStream | fieldName result | fieldName := aStream upTo: Character space. fieldName = 'CRC:' ifFalse: [^AbstractCodeProbe unknowLoadField: fieldName on: aStream expected: 'CRC:']. result := Number readFrom: aStream. aStream next. "swallow cr" ^result "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>comparing</category>
= aMethod "Compare the receiver to another object. Answer true if the other object is an exactly equivalent method. Override to ensure we compare attributes." | list | super = aMethod ifFalse: [^false]. list := aMethod attributeMessages. list size = self attributeMessages size ifFalse: [^false]. list := OrderedCollection withAll: list. self attributeMessages do: [:msg | list remove: msg ifAbsent: [^false]]. ^true
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>accessing-literals</category>
allLiteralsDo: aBlock super allLiteralsDo: aBlock. self attributeMessages do: [:msg | aBlock value: msg selector. self traverse: msg arguments with: aBlock].
allSymbolLiteralsDo: aBlock super allSymbolLiteralsDo: aBlock. self attributeMessages do: [:msg | aBlock value: msg selector. self traverse: msg arguments with: [:sublit| sublit isSymbol ifTrue: [aBlock value: sublit]]].
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>accessing</category>
attributeAt: key ifAbsent: exceptionBlock attributes == nil ifTrue: [^exceptionBlock value]. ^self attributes at: key ifAbsent: exceptionBlock
attributeMessages attributes class == IdentityDictionary ifTrue: [self attributes: attributes]. ^attributes
attributeMessages: anArray attributes := anArray == nil ifFalse: [anArray asArray]
attributes "Answer the receiver's attribute dictionary. If no attributes are defined, answer nil." ^attributes class == Array ifTrue: [self messagesToDict: attributes] ifFalse: [attributes]
attributes: aDictionary | list | list := Array new. aDictionary keysAndValuesDo: [:key :value | (key includes: $_) ifTrue: [self error: (#BadOldstyleKey << #pdp >> 'Bad old-style key')]. list := list copyWith: (Message selector: (key copyWith: $:) asSymbol argument: value)]. self attributeMessages: list
environment "Answer the NameSpace in which this compiled code was compiled. If not known, answer nil." | messages | messages := self attributeMessages. messages == nil ifFalse: [1 to: messages size do: [:i | | msg | msg := messages at: i. (CompiledCode nameSpaceSelectors includes: msg selector) ifTrue: [msg arguments first == nil ifTrue: [self error: 'Nil environment']. ^msg arguments first]]]. ^super environment
hasEnvironment "Return true if we have an environment specified other than that of our class" | messages | messages := self attributeMessages. ^messages notNil and: [messages anySatisfy: [:msg | CompiledCode nameSpaceSelectors includes: msg selector]]
resourceType self attributeMessages do: [:msg | msg selector == #resource: ifTrue: [^msg arguments first]]. ^nil
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>private</category>
copyStateFromOldVersion: oldMethod "This message is sent by CodeRegenerator to a newly generated method, to allow the method to copy over the source pointer and any other information that the CodeRegenerator would not know how to preserve." super copyStateFromOldVersion: oldMethod. self attributeMessages: oldMethod attributeMessages
messagesToDict: list | d | d := IdentityDictionary new. list do: [:msg | d at: (self class transformSelectorToKey: msg selector) put: (msg arguments size = 0 ifTrue: [nil] ifFalse: [msg arguments first])]. ^d
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>initialize-release</category>
from: aCompiledMethod full: fullFlag self attributeMessages: aCompiledMethod attributeMessages. ^super from: aCompiledMethod full: fullFlag
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>binary storage</category>
isCodeReaderEquivalentTo: aNewlyLoadedMethod "Override to ensure we compare attributes." | theirAttributes | (super isCodeReaderEquivalentTo: aNewlyLoadedMethod) ifFalse: [^false]. theirAttributes := aNewlyLoadedMethod attributeMessages. theirAttributes size = self attributeMessages size ifFalse: [^false]. self attributeMessages with: theirAttributes do: [:ourMsg :theirMsg | (ourMsg isCodeReaderEquivalentTo: theirMsg) ifFalse: [^false]]. ^true
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod <category>testing</category>
refersToLiteral: aLiteral "Answer true if this method (or any submethod) refers to the given literal, directly or indirectly as an element of an array. We do not include special selector references. We duplicate the code of literalsDo: for speed." ^(super refersToLiteral: aLiteral) or: [self attributeMessages contains: [:msg | (msg selector refersToLiteral: aLiteral) or: [msg arguments refersToLiteral: aLiteral]]]
</methods> <methods> CraftedSmalltalk.ProbedAnnotatedMethod class <category>utilities</category>
transformKeyToSelector: key | new | new := key copyWith: $:. new replaceAll: $_ with: $:. ^new asSymbol
transformSelectorToKey: selector | new | new := selector asString. new replaceAll: $: with: $_. new last = $_ ifTrue: [new := new copyFrom: 1 to: new size-1]. ^new asSymbol
</methods> <methods> CraftedSmalltalk.WatchWindowView <category>private</category>
changeText: aText "The paragraph to be edited is changed to aText." self repairDamage. "Since we are not using invalidation we need to be safe." self deselect. self editText: aText. self selectionIndex: self text size + 1. self selectAndScroll. self clearInside. self displayOn: self graphicsContext
</methods> <methods> CraftedSmalltalk.WatchWindowView <category>updating</category>
updateRequest "Answer regarding whether the receiver may change." ^true
</methods> <methods> CraftedSmalltalk.PDPMthdListMsgRcvdInstrumenterGUIModel <category>private</category>
commonParentIn: clsCollection | parent clsStream cls | clsCollection do: [:cl | (cl includesBehavior: Object) ifFalse: [^nil]]. parent := clsCollection first. clsStream := ReadStream on: clsCollection. [clsStream atEnd] whileFalse: [((cls := clsStream next) includesBehavior: parent) ifFalse: [parent := parent commonSuperclass: cls. clsStream reset]]. ^parent
determineBaseClass | clsList records | records := self selectedRecords asOrderedCollection. clsList := records isEmpty ifTrue: [origMethods collect: [:ac | ac key]] ifFalse: [records collect: [:rec | rec methodClass]]. classUnderTest := self commonParentIn: clsList.
</methods> <methods> CraftedSmalltalk.PDPMthdListMsgRcvdInstrumenterGUIModel <category>operation</category>
newSelection self determineBaseClass. self buildVariableMenu.
updateList methods := SortedCollection sortBlock: [:aa :b | aa nameString < b nameString]. origMethods do: [:ac | (ac key compiledMethodAt: ac value) isProbeable ifTrue: [methods add: (MethodActionRecord action: nil class: ac key selector: ac value)]]. panelList list: (methods collect: [:ac | ac nameString]).
</methods> <methods> CraftedSmalltalk.PDPMthdListMsgRcvdInstrumenterGUIModel <category>initialize-release</category>
on: aColl classUnderTest := Object. origMethods := aColl. self openInterface.
postBuildWith: aBuilder super postBuildWith: aBuilder. panelList selectionIndexHolder onChangeSend: #newSelection to: self.
</methods> <methods> CraftedSmalltalk.CRC32Function class <category>converting</category>
crc32Of: aByteArray ^self crc32Of: aByteArray initial: 0 "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
crc32Of: aByteArray initial: initialCRC | crc | crc := initialCRC. 1 to: aByteArray size do: [:i | crc := (CRC32Table at: ((aByteArray at: i) bitXor: (crc quo: 16r1000000)) + 1) bitXor: ((crc bitAnd: 16rffffff) * 256)]. ^crc "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.CRC32Function class <category>class initialization</category>
initialize self initializeCRC32Table
initializeCRC32Table | ans | CRC32Table := Array new: 256. 0 to: 255 do: [:i | ans := i * 16r1000000. 1 to: 8 do: [:j | ans := ans * 2. ans < 16r100000000 ifFalse: [ans := ans bitXor: 16r4c11db7.]. ans := ans bitAnd: 16rffffffff]. CRC32Table at: i + 1 put: ans]. "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPManager class <category>utilities</category>
about | dialog builder | dialog := SimpleDialog new. builder := dialog builder. builder labelAt: #versionLabel put: ((#Version1s << #pdp >> 'Version <1s>') expandMacrosWith: self versionString). builder aspectAt: #ok put: [dialog close]. dialog allButOpenFrom: (UISpecification from: self aboutSpec). dialog builder openDialog "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
browseAllProbedMethods "Create and schedule a MessageListBrowser for all probed methods." ^MethodCollector new openListBrowserOn: self allProbedMethodDefinitions label: (#ProbedMethods << #pdp >> 'Probed Methods') initialSelection: nil "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
findSelectedProbeEmphasisIn: aText | evalBlock | evalBlock := [:emp | (emp class == ProbeCharacterStyle and: [emp key == #probe or: [emp key == #tempProbe]]) ifTrue: [^emp]]. aText runs values do: [:aValue | (aValue isKindOf: Array) ifTrue: [aValue do: [:obj | evalBlock value: obj]] ifFalse: [evalBlock value: aValue]]. ^nil "Smalltalk Professional Debug Package Version 3.1 (c) 2003 Crafted Smalltalk"
purgeUnusedDebugVariables "PDPManager purgeUnusedDebugVariables" | warray index da | da := debugVariables bindingFor: #DebugActive. "Hold onto binding so it will not be removed." warray := WeakArray new: debugVariables size. index := 1. debugVariables associationsDo: [:ac | warray at: index put: ac. index := index + 1]. debugVariables := Dictionary new. ObjectMemory garbageCollect. warray do: [:ac | ac == warray tombstone ifFalse: [debugVariables add: ac]]
purgeUnusedWatchWindows "PDPManager purgeUnusedWatchWindows" | ids newWatches ac | ObjectMemory garbageCollect. ids := Set new. DisplayProbe withAllSubclasses do: [:probeClass | probeClass allInstances do: [:aProbe | ids add: aProbe windowID]]. newWatches := Dictionary new. ids do: [:anID | ac := watchWindows associationAt: anID ifAbsent: [nil]. ac isNil ifFalse: [newWatches add: ac]]. watchWindows := newWatches. "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
toggleDebugging self debugActive: self debugActive not. "Smalltalk Professional Debug Package Version 3.1 (c) 2002 Crafted Smalltalk"
togglePermTempProbeType defaultToPermanentProbe := defaultToPermanentProbe not. "Smalltalk Professional Debug Package Version 3.0 (c) 2001 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPManager class <category>accessing</category>
addDebugVariable: aSymbol self addDebugVariable: aSymbol value: nil "Smalltalk Professional Debug Package Version 3.1 (c) 1995-2002 Crafted Smalltalk"
addDebugVariable: aSymbol value: anObject debugVariables at: aSymbol put: anObject "Smalltalk Professional Debug Package Version 3.1 (c) 2002 Crafted Smalltalk"
debugActive ^debugVariables at: #DebugActive "Smalltalk Professional Debug Package Version 1.51 (c) 1997 Crafted Smalltalk"
debugActive: aBoolean debugVariables at: #DebugActive put: aBoolean "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
debugVariableNames ^debugVariables keys asArray "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
debugVariables ^debugVariables "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
isPermanentProbeDefault ^defaultToPermanentProbe
permanentProbeIsDefault ^defaultToPermanentProbe
permanentProbeIsDefault: aBoolean defaultToPermanentProbe := aBoolean
versionString ^'3.1'
</methods> <methods> CraftedSmalltalk.PDPManager class <category>private</category>
allProbedMethodDefinitions ObjectMemory garbageCollect. ^ProbedCompiledMethod allInstalledProbedMethods collect: [:meth | MethodDefinition class: meth mclass selector: meth selector]. "Smalltalk Professional Debug Package Version 3.1 (c) 2002 Crafted Smalltalk"
newWatchWindow ^WatchWindowHolder new "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
nextWindowID | id | lastID := lastID + 1. id := lastID printString asSymbol. watchWindows at: id put: self newWatchWindow. ^id "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPManager class <category>probes - recompiling</category>
basicReinsertProbesAndIndices: probesAndIndices into: probedMethod | probesInError | probesInError := OrderedCollection new. probesAndIndices do: [:ac | | probe index newRecord | probe := ac key baseParent copy. index := ac value. newRecord := probedMethod probeRecordFor: (index to: index). probe record: newRecord. (probe updateTempVarForMethod: probedMethod) ifTrue: [probedMethod addProbe: probe] ifFalse: [newRecord updateMethod: probedMethod. "update mclass and selector for reporting" probesInError add: probe]]. probesInError addAll: probedMethod recompileProbes. ProbedCompiledMethod reportOnFailedProbes: probesInError. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
getProbesAndIndicesFrom: aText | runs values result emphasis position | result := OrderedCollection new. runs := aText runs runs. values := aText runs values. position := 1. 1 to: runs size do: [:i | emphasis := values at: i. (emphasis isKindOf: Array) ifTrue: [emphasis do: "There should be only one probe in the emphasis if any." [:emp | emp class == ProbeCharacterStyle ifTrue: [result add: emp value -> position]]] ifFalse: [emphasis class == ProbeCharacterStyle ifTrue: [result add: emphasis value -> position]]. position := position + (runs at: i)]. ^result "Smalltalk Professional Debug Package Version 3.1 (c) 2003 Crafted Smalltalk"
reinsertProbesAfterMethod: newMethod recompileFor: aText | oldProbes | newMethod isNil ifTrue: [^self]. newMethod isProbeable ifFalse: [^newMethod]. oldProbes := self getProbesAndIndicesFrom: aText. oldProbes isEmpty ifTrue: [^newMethod]. (Dialog choose: (#RemoveOrKeepOldProbes << #pdp >> 'Remove or keep old probes?') labels: (Array with: (#Remove << #pdp >> 'Remove') with: (#Keep << #pdp >> 'Keep')) values: #(false true) default: true) ifFalse: [^newMethod]. ^self reinsertProbesAndIndices: oldProbes into: newMethod. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
reinsertProbesAndIndices: probesAndIndices into: newMethod | probedMethod | probedMethod := newMethod newFullProbedMethod. self basicReinsertProbesAndIndices: probesAndIndices into: probedMethod. probedMethod hasAnyProbes ifFalse: [^newMethod]. probedMethod noNotifyInstall. ^probedMethod "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
spawnRemovedProbedMethodsBrowser | removedMethods answer | removedMethods := ProbedCompiledMethod removedMethods. removedMethods isEmpty ifTrue: [^self]. answer := Dialog choose: (#ProbesRemovedWhatToDo << #pdp >> 'Probes were removed due to class recompliation. What do you want to do with them?') labels: (Array with: (#ReinstallAll << #pdp >> 'Reinstall All') with: (#SelectivelyReinstall << #pdp >> 'Selectively Reinstall') with: (#Discard << #pdp >> 'Discard')) values: #(0 1 2) default: 0. answer = 2 ifTrue: [^self]. answer = 0 ifTrue: [[ProbedCompiledMethod recompileAndInsertProbesFrom: removedMethods] fork. ^self]. [RemovedProbedMethodsBrowser onMethods: removedMethods] fork. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPManager class <category>synchronizing tools</category>
cancelMethodChangeNotificationFor: aTool methodDependents remove: aTool ifAbsent: []
changedMethodFrom: oldMethod to: newMethod by: aBrowser | coll | coll := OrderedCollection new. methodDependents do: [:ab | coll add: ab]. coll do: [:activeTool | activeTool changedMethodFrom: oldMethod to: newMethod by: aBrowser] "Smalltalk Professional Debug Package Version 3.0 (c) 2002 Crafted Smalltalk"
notifyOnMethodChanged: aTool methodDependents add: aTool
revokeMethodChangeNotificationFor: aTool methodDependents remove: aTool ifAbsent: []
</methods> <methods> CraftedSmalltalk.PDPManager class <category>watch windows</category>
display: aString on: windowID for: aProbe (self getWatchWindow: windowID for: aProbe) showString: aString. "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
getWatchWindow: windowID for: aProbe | windowKey | windowKey := windowID. (windowKey isNil or: [windowKey isEmpty]) ifTrue: [aProbe windowID: (windowKey := self nextWindowID)]. (watchWindows includesKey: windowKey) ifFalse: [watchWindows at: windowKey put: ((self newWatchWindow) label: aProbe labelString; yourself)]. ^watchWindows at: windowKey "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
openWatchWindow: windowID for: aProbe | window | window := self getWatchWindow: windowID for: aProbe. window reopen. "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
windowHolders ^watchWindows "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPManager class <category>launcher menu</category>
getEnableProbeDebuggingLabel ^self debugActive ifTrue: [(#Disable_Probes << #pdp >> 'Disable &Probes')] ifFalse: [(#Enable_Probes << #pdp >> 'Enable &Probes')]. "Smalltalk Professional Debug Package Version 1.51 (c) 1995,1997 Crafted Smalltalk"
getPermTempProbeLabel ^defaultToPermanentProbe ifTrue: [(#DefaultTo_TempProbes << #pdp >> 'Default to &Temp Probes')] ifFalse: [(#DefaultTo_PermProbes << #pdp >> 'Default to &Perm Probes')]. "Smalltalk Professional Debug Package Version 3.0 (c) 2001 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPManager class <category>class initialization</category>
initialize "PDPManager initialize." debugVariables := Dictionary new. self addDebugVariable: #DebugActive value: true. watchWindows isNil ifTrue: [watchWindows := Dictionary new. lastID := 0]. methodDependents := PDPWeakCollection new: 5. defaultToPermanentProbe := false. "Smalltalk Professional Debug Package Version 3.1 (c) 1997 - 2002 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ProbeCreationSpec <category>accessing</category>
conditional: aBoolean conditional := aBoolean
permanent: aBoolean permanent := aBoolean
probeClass ^probeClass
probeClass: aClass probeClass := aClass
selectWindowParams ^selectWindowParams
selectWindowParams: aBoolean selectWindowParams := aBoolean
setConditional conditional := true
setIsAutoProbe isAutoProbe := true.
setPermanent permanent := true
setTemporary permanent := false
setUnconditional conditional := false
</methods> <methods> CraftedSmalltalk.ProbeCreationSpec <category>initialize-release</category>
initialize isAutoProbe := false.
type: type conditional: cond permanent: perm permanent := perm. probeClass := type. conditional := cond.
</methods> <methods> CraftedSmalltalk.ProbeCreationSpec <category>testing</category>
isAutoProbe ^isAutoProbe
isConditional ^conditional
isPermanent ^permanent
</methods> <methods> CraftedSmalltalk.ProbeCreationSpec class <category>instance creation</category>
new ^super new initialize
type: type conditional: cond permanent: perm ^self new type: type conditional: cond permanent: perm "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.PDPTransientWarning <category>interface opening</category>
on: aString labelText := aString. self openInterface: #windowSpec.
postBuildWith: aBuilder (aBuilder componentAt: #warning) labelString: labelText. aBuilder window displayBox: (0 @ 0 extent: aBuilder component preferredBounds extent + (50 @ 40)).
postOpenWith: aBuilder [(Delay forMilliseconds: 1500) wait. aBuilder window topComponent model close] forkAt: Processor activeProcess priority + 1.
</methods> <methods> CraftedSmalltalk.PDPTransientWarning class <category>instance creation</category>
on: aString self new on: aString "Smalltalk Professional Debug Package Version 2.5 (c) 1999 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.RawRemoteVariable <category>accessing</category>
debuggerIndex ^slot value debuggerIndex
nesting ^slot value nesting
</methods> <methods> CraftedSmalltalk.RawRemoteVariable <category>private</category>
doItContextVar ^VariableNode new name: 'DOITCONTEXT'
</methods> <methods> CraftedSmalltalk.RawRemoteVariable <category>code generation</category>
emitLoad: codeStream from: var | builder node | builder := ProgramNodeBuilder new. node := builder newMessageReceiver: self doItContextVar selector: #getTempVar: arguments: (Array with: (builder newLiteralValue: slot value)). node sourcePosition: var sourcePosition. node emitValue: codeStream
emitStore: codeStream value: value from: assignment | builder node | builder := ProgramNodeBuilder new. node := builder newMessageReceiver: self doItContextVar selector: #put:intoTempVar: arguments: (Array with: value with: (builder newLiteralValue: slot value)). node sourcePosition: assignment sourcePosition. ^node emitValue: codeStream
emitStorePop: codeStream value: value from: assignment | builder node | builder := ProgramNodeBuilder new. node := builder newMessageReceiver: self doItContextVar selector: #put:intoTempVar: arguments: (Array with: value with: (builder newLiteralValue: slot value)). node sourcePosition: assignment sourcePosition. ^node emitEffect: codeStream
</methods> <methods> CraftedSmalltalk.RawRemoteVariable <category>initialize-release</category>
slot: aSlot slot := aSlot.
</methods> <methods> CraftedSmalltalk.ProbeExprCompiler <category>public access</category>
compileProbeExpression: textOrStream forProbe: aProbe inClass: aClass beginScope: scope notifying: aRequestor ifFail: failBlock "Compiles the sourceStream into a parse tree, then generates code into a method. If receiver is not nil, then the text can refer to instance variables of that receiver (the Inspector uses this). If aContext is not nil, the text can refer to temporaries in that context (the Debugger uses this). If aRequestor is not nil, then it will receive a notify:at: message if an error is deteted. Finally, the compiled method is returned" | lastLocalScope method scope1 handler methodNode staticScope | class := aClass. lastLocalScope := scope. [lastLocalScope outerScope class == StaticScope] whileFalse: [lastLocalScope := lastLocalScope outerScope]. staticScope := lastLocalScope outerScope. scope1 := StaticScope variables: PDPManager debugVariables. scope1 outerScope: staticScope. aProbe variables isEmpty ifFalse: [scope1 := (StaticScope variables: aProbe variables) outerScope: scope1]. lastLocalScope outerScope: scope1. self from: textOrStream class: class context: (self scopeForProbeExpressionsOuterScope: scope) notifying: aRequestor. handler := requestor isNil ifTrue: [SilentProbeExprCompilerErrorHandler new] ifFalse: [self interactiveCompilerErrorHandlerClass new]. [methodNode := handler forClass: targetClass on: sourceStream for: requestor onFailDo: [^failBlock value] do: [:src | self translate: src ifFail: [^failBlock value] handler: handler]] valueNowOrOnUnwindDo: [lastLocalScope outerScope: staticScope]. method := methodNode generate. method allLiteralsDo: [:obj | (obj isVariableBinding and: [obj isDeferred]) ifTrue: [obj resolveBinding]]. ^method
evaluate: textOrStream in: aContext allowReceiver: allowSelf receiver: receiver environment: env notifying: aRequestor ifFail: failBlock "This method should be sent to this compiler class only by a TextController that is part of a probe expression editor." | value method editor | Cursor execute show. editor := aRequestor performer. [method := self compileProbeExpression: textOrStream forProbe: editor probe inClass: editor probedClass beginScope: editor nameScope notifying: aRequestor ifFail: [Cursor normal show. ^failBlock value]. value := method mclass basicNew performMethod: method with: nil with: nil] ensure: [Cursor normal show]. ^value
evaluate: textOrStream in: aContext receiver: receiver notifying: aRequestor ifFail: failBlock "This method should be sent to this compiler class only by a TextController that is part of a probe expression editor." | value method editor | Cursor execute show. editor := aRequestor performer. [method := self compileProbeExpression: textOrStream forProbe: editor probe inClass: editor probedClass beginScope: editor nameScope notifying: aRequestor ifFail: [Cursor normal show. ^failBlock value]. value := method mclass basicNew performMethod: method with: nil with: nil] ensure: [Cursor normal show]. ^value
</methods> <methods> CraftedSmalltalk.ProbeExprCompiler <category>private</category>
newCodeStream "Return an appropriate code stream" | stream | stream := super newCodeStream. compileForProbes == true ifTrue: [stream makeFullBlock: true]. ^stream
scopeForClass ^(context isKindOf: NameScope) ifTrue: [context] ifFalse: [super scopeForClass]
scopeForProbeExpressionsOuterScope: aScope | localScope temps | localScope := LocalScope new. localScope addVariable: TopOfStackVariable new named: 'TopOFStack'. temps := aScope temps reject: [:var | var key first = $.]. temps do: [:var | localScope addVariable: (RawRemoteVariable new slot: var) named: var key]. localScope outerScope: aScope. ^localScope
translate: aStream ifFail: failBlock handler: handler "This method is used only to compile or evaluate probe expressions." | methodNode holder codeStream method | "Make special provisions for compiling methods in classes that still use the old parser." methodNode := PDPParser new parse: aStream class: class environment: self environment noPattern: false context: context notifying: handler builder: ProgramNodeBuilder new saveComments: false ifFail: [^failBlock value]. (BlockAnalyzer new analyze: methodNode inClass: class context: context) storeHintsForStandardSmalltalk. handler selector: methodNode selector. "save selector in case of error" codeStream := self newCodeStream. codeStream class: targetClass outerScope: self scopeForClass; requestor: handler. methodNode emitValue: codeStream inContext: nil. method := codeStream makeMethod: methodNode. method := method withAdditionalPropertiesFrom: methodNode. holder := self newMethodHolder. holder node: methodNode. holder method: method. ^holder
</methods> <methods> CraftedSmalltalk.ProbeExprCompiler <category>accessing</category>
setCompileForProbes compileForProbes := true
</methods> <methods> CraftedSmalltalk.ProbeExprCompiler class <category>accessing</category>
doitContextVarName ^'DOITCONTEXT' "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.DisplayInstanceVarProbe <category>responses</category>
actOn: aContext (self test: aContext) ifTrue: [PDPManager display: (aContext homeReceiver instVarAt: index) debugString on: windowID for: self]
</methods> <methods> CraftedSmalltalk.DisplayInstanceVarProbe <category>initialize-release</category>
createLabelString labelString value: ((#Ivar1sIn2sAt3p << #pdp >> 'Ivar %<<1s>%> in <2s> at <3p>') expandMacrosWith: self variableName with: self methodString with: self characterIndex)
updateInstanceVarIndexForMethod: probedMethod "Update the receiver's index for the named instance variable. Return true if the iVar still exists, otherwise return false." index := probedMethod mclass allInstVarNames indexOf: name. ^index ~~ 0
updateMiscFromProbe: aProbe super updateMiscFromProbe: aProbe. index := aProbe variableIndex. name := aProbe variableName.
</methods> <methods> CraftedSmalltalk.DisplayInstanceVarProbe <category>accessing</category>
editorLabelString ^((#EditIVarWatchProbeOn1s << #pdp >> 'Edit Instance Variable Watch on: %<<1s>%>') expandMacrosWith: name)
</methods> <methods> CraftedSmalltalk.DisplayInstanceVarProbe <category>saving-loading</category>
postLoadIntoMethod: probedMethod ^self updateInstanceVarIndexForMethod: probedMethod
</methods> <methods> CraftedSmalltalk.PDPParser <category>expression types-^value/error</category>
method: fromDoIt context: ctxt "pattern [ | temporaries ] block => MethodNode" | start pat messageComment methodNode tempNodes | start := mark. pat := Array with: #DOIT:PROBE: with: (Array with: (builder newParameterVariable: (builder newVariableName: 'DOITCONTEXT')) with: (builder newParameterVariable: (builder newVariableName: 'ThisProbe'))). "pat={selector, arguments}" messageComment := currentComment. currentComment := nil. methodNode := builder newMethodSelector: (pat at: 1). tempNodes := tokenType == #verticalBar ifTrue: [self temporaries] ifFalse: [newLanguage ifTrue: [nil] ifFalse: [#()]]. self statementsArgs: (pat at: 2) temps: tempNodes. tokenType == #doIt ifFalse: [^self expected: (#NothingMore << #pdp >> 'Nothing more')]. methodNode block: parseNode. methodNode addComment: messageComment. methodNode sourcePosition: (start to: self endOfLastToken). ^methodNode
</methods> <methods> CraftedSmalltalk.SilentProbeExprCompilerErrorHandler <category>error handling</category>
error: type with: message at: sourcePosition Transcript cr; nextPutAll: ((#ErrorIn1sDash2sAt3p << #pdp >> 'Error in <1s> - <2s> at: <3p>') expandMacrosWith: self methodString; with: message; with: sourcePosition); endEntry. ^self abort
error: type with: message in: node from: codeStream | msg | msg := message isVariableBinding ifTrue: [message key] ifFalse: [message isString ifTrue: [message] ifFalse: ['?']]. Transcript cr; nextPutAll: ((#ErrorDash1s2sIn3s << #pdp >> 'Error - <1s> "<2s>" in <3s>') expandMacrosWith: type with: msg with: self methodString); endEntry. ^self abort
</methods> <methods> CraftedSmalltalk.SilentProbeExprCompilerErrorHandler <category>private</category>
methodString selector isNil ifTrue: [^(#UnboundMethod << #pdp >> 'Unbound method') asString]. ^class shortName , '>>' , selector string
</methods> <methods> CraftedSmalltalk.WatchWindowHolder <category>private</category>
createWindow | aView subViews visual labelBottom | window := ScheduledWindow model: self label: (#WatchWindow << #pdp >> 'Watch window') minimumSize: 200@100. window icon: (Icon constantNamed: #watchWindow). aView := WatchWindowView model: self. aView controller performer: self. aView controller menuHolder: (ValueHolder with: (Menu labelList: #((again undo) (copy cut paste) ('do it' 'print it' 'inspect') (cancel) (hardcopy) ('log on' 'log off')) values: #(again undo copySelection cut paste doIt printIt inspectIt cancel hardcopy doLog dontLog))). subViews := CompositePart new. visual := label asText allBold asParagraph. labelBottom := visual preferredBounds height + 4. labelView := BorderedWrapper on: visual in: (LayoutFrame leftFraction: 0 offset: 0 rightFraction: 1 offset: 0 topFraction: 0 offset: 0 bottomFraction: 0 offset: labelBottom) border: LookPreferences defaultBorder. subViews add: labelView. subViews add: (LookPreferences edgeDecorator on: aView) in: (LayoutFrame leftFraction: 0 offset: 0 rightFraction: 1 offset: 0 topFraction: 0 offset: labelBottom bottomFraction: 1 offset: 0). window component: subViews. ^window
reopen window notNil ifTrue: [^self]. self createWindow. displayBox isNil ifTrue: [window open] ifFalse: [window openIn: displayBox]
</methods> <methods> CraftedSmalltalk.WatchWindowHolder <category>accessing</category>
doLog doLogging := true. self endEntry.
dontLog self endEntry. doLogging := false.
label window isNil ifTrue: [^label]. ^window label
label: aString window isNil ifFalse: [labelView component: aString asText allBold asParagraph]. label := aString
showString: aString self reopen. doLogging ifTrue: [self show: aString; cr] ifFalse: [value := aString asText. self changed: #update.]
</methods> <methods> CraftedSmalltalk.WatchWindowHolder <category>initialize-release</category>
initialize super initialize. doLogging := true.
</methods> <methods> CraftedSmalltalk.WatchWindowHolder <category>managing</category>
removeDependent: anObject window == anObject ifTrue: [displayBox := window displayBox. labelView := window := nil]. super removeDependent: anObject
</methods> <methods> CraftedSmalltalk.DisplayProbeEditor <category>interface opening</category>
createEditor ^self createEditorOn: #displayEditorSpec
hookUpWindowParameters self hookUpWindowParametersTo: builder
hookUpWindowParametersTo: aBuilder | idHolder | idHolder := ValueHolder with: workingCopyProbe windowID. aBuilder aspectAt: #windowID put: idHolder. aBuilder aspectAt: #openWatchWindow put: [(aBuilder componentAt: #idEntry) widget controller accept. idHolder value isEmpty ifTrue: [Dialog warn: (#ValidWindowIDRequired << #pdp >> 'A valid window ID must be first entered.')] ifFalse: [workingCopyProbe setLabel. PDPManager openWatchWindow: workingCopyProbe windowID for: workingCopyProbe]]. idHolder onChangeSend: #value to: [workingCopyProbe windowID: idHolder value string asSymbol]. aBuilder aspectAt: #selectID put: [|result| (result := self selectWindowID) isNil ifFalse: [idHolder value: result]]. aBuilder aspectAt: #changeLabel put: [self openLabelEditor].
invokePostOpen
openWindowParamSelector | dialog oldGuess | dialog := SimpleDialog new. dialog builder source: self. self hookUpWindowParametersTo: dialog builder. oldGuess := SimpleDialog classPool at: #GuessParentWindow. SimpleDialog guessParentWindow: false. dialog allButOpenFrom: (UISpecification from: self class windowParmOpenSpec). SimpleDialog guessParentWindow: oldGuess. dialog builder openDialog. dialog accept value ifTrue: [originalProbe updateFromWorkingCopy: workingCopyProbe]
preBuildWith: aBuilder "This message is sent by the builder prior to beginning construction of either a SubCanvas or a complete window." self hookUpWindowParameters
</methods> <methods> CraftedSmalltalk.DisplayProbeEditor <category>actions</category>
openLabelEditor | label | label := Dialog request: (#EnterNewWindowLabel << #pdp >> 'Enter new window label') initialAnswer: workingCopyProbe labelString. label isEmpty ifFalse: [workingCopyProbe labelString: label].
selectWindowID | entries list | entries := OrderedCollection new. list := OrderedCollection new. PDPManager windowHolders associationsDo: [:ac| entries add: ac key. list add: '<' , ac key printString , '> ' , ac value label asString]. list isEmpty ifTrue: [Dialog warn: (#ThereAreNoWindowsAvailable << #pdp >> 'There are no windows available.'). ^nil]. ^Dialog choose: (#SelectWindowIDWindow << #pdp >> 'Select Window <ID> Window') fromList: list values: entries lines: 20 cancel: []
</methods> <methods> CraftedSmalltalk.TopOfStackVariable <category>accessing</category>
debuggerIndex ^0
</methods> <methods> CraftedSmalltalk.TopOfStackVariable <category>code generation</category>
emitLoad: codeStream from: var | builder node | builder := ProgramNodeBuilder new. node := builder newMessageReceiver: self newDoitContextNode selector: #top. node sourcePosition: var sourcePosition. node emitValue: codeStream
emitStore: codeStream value: value from: assignment (self storeNode: value from: assignment) emitValue: codeStream
emitStorePop: codeStream value: value from: assignment (self storeNode: value from: assignment) emitEffect: codeStream
</methods> <methods> CraftedSmalltalk.TopOfStackVariable <category>code generation-private</category>
emitStore: codeStream from: var "TopOfStackVariable implements the public message emitStore:value:from:, not the private message. " self shouldNotImplement
emitStorePop: codeStream from: var "TopOfStackVariable implements the public message emitStorePop:value:from:, not the private message. " self shouldNotImplement
</methods> <methods> CraftedSmalltalk.TopOfStackVariable <category>private</category>
newDoitContextNode ^VariableNode new name: ProbeExprCompiler doitContextVarName
storeNode: valueNode from: assignment | builder node | builder := ProgramNodeBuilder new. node := builder newMessageReceiver: self newDoitContextNode selector: #storeTop: arguments: (Array with: valueNode). node sourcePosition: assignment sourcePosition. ^node
</methods> <methods> CraftedSmalltalk.ProbeInsertionRecord <category>accessing</category>
atEnd ^atEnd
blockMethodIndex ^blockIndex
bytesInBytecodes ^bytesInBytecodes
bytesInBytecodes: anObject bytesInBytecodes := anObject
characterIndex ^characterIndex
fixPCFor: aPC amount: delta aPC > pc ifTrue: [^self]. pc := pc + delta
fixPCFor: aPC amount: delta doEqualPC: doEqualNot aPC > pc ifTrue: [^self]. aPC = pc & doEqualNot ifTrue: [^self]. pc := pc + delta
getLastEntryFrom: aProbedCompiledMethod | map i nuEntry end anEntry | atEnd ifTrue: [^self]. map := aProbedCompiledMethod sourceMapAt: blockIndex. i := mapEntry index + 1. end := map size. nuEntry := mapEntry. [i < end and: [(anEntry := map at: i) key == pc]] whileTrue: [anEntry end notNil ifTrue: [nuEntry := anEntry]. i := i + 1]. nuEntry == mapEntry ifTrue: [^self]. mapEntry := nuEntry. pc := mapEntry key. characterIndex := mapEntry value first min: mapEntry value last.
insertionPC ^pc
insertionPCFor: aMethod mclass := aMethod homeMethod mclass. selector := aMethod homeMethod selector. mapEntry := aMethod sourceMap at: self mapIndex. pc := atEnd ifTrue: [mapEntry end] ifFalse: [mapEntry key]. ^pc
insertionRange ^characterIndex to: characterIndex
mapIndex ^mapEntry index
mclass ^mclass
mclass: aClass mclass := aClass.
methodString ^mclass name , '>>' , selector asString
registerPCsWith: aPCRegistry aPCRegistry register: self atPC: pc
selector ^selector
updateMethod: aProbedMethod mclass := aProbedMethod homeMethod mclass. selector := aProbedMethod homeMethod selector.
updatePCs: block | new | new := block value: pc. new == nil ifFalse: [pc := new].
</methods> <methods> CraftedSmalltalk.ProbeInsertionRecord <category>initialize-release</category>
characterIndex: ci blockIndex: bli mapEntry: me atEnd: endFlag characterIndex := ci. blockIndex := bli. mapEntry := me. atEnd := endFlag. mapEntry == nil ifTrue: [^self]. pc := atEnd ifTrue: [mapEntry end] ifFalse: [mapEntry key]
</methods> <methods> CraftedSmalltalk.ProbeInsertionRecord <category>comparing</category>
= aRecord ^aRecord class == self class and: [(aRecord characterIndex = characterIndex) & (aRecord insertionPC = pc) & (aRecord blockMethodIndex = blockIndex)]
hash ^(blockIndex - 1 * 100 + characterIndex) * 100 + pc
</methods> <methods> CraftedSmalltalk.ProbeInsertionRecord <category>saving-loading</category>
loadFrom: aStream | fieldName | fieldName := aStream upTo: Character space. fieldName = 'CharacterPosition:' ifFalse: [^AbstractCodeProbe unknowLoadField: fieldName on: aStream expected: 'CharacterPosition:']. characterIndex := Number readFrom: aStream. aStream next. "swallow cr"
saveOn: aStream aStream nextPutAll: 'CharacterPosition: '. characterIndex printOn: aStream. aStream cr.
</methods> <methods> CraftedSmalltalk.ProbeInsertionRecord <category>testing</category>
pcRangeExcludes: aLocation ^mapEntry pcRangeExcludes: aLocation
</methods> <methods> CraftedSmalltalk.ProbeInsertionRecord class <category>instance creation</category>
characterIndex: ci blockIndex: bli mapEntry: me atEnd: endFlag ^self new characterIndex: ci blockIndex: bli mapEntry: me atEnd: endFlag "Smalltalk Professional Debug Package Version 1.5 (c) 1995,1997 Crafted Smalltalk"
createFrom: aStream ^self new loadFrom: aStream
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>private</category>
createAndAddProbesFor: aRec | refs | methodString := ((#x1sAt << #pdp >> '<1s> at ') expandMacrosWith: aRec nameString). refs := probedMethod collectReferencesTo: iVarName. refs do: [:node | node isRead ifTrue: [aRec isRead ifTrue: [probeRecord := node probeRecordAtEnd. actionString := (#readIn << #pdp >> 'read in ') asString]] ifFalse: [aRec isWrite ifTrue: [probeRecord := node probeRecordAtStart. actionString := (#writeIn << #pdp >> 'write in ') asString]]. probeRecord isNil ifFalse: [self createNewProbe. self perform: probeCompletionSelector. probeRecord := nil.]]
createExpression self createTopOfStackExpression.
createTopOfStackExpression templateProbe compileExpression: ' ^TopOFStack debugString' inClass: classUnderTest scope: startingScope.
initializeLabelstring self initializeLabelstringToIvar.
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>expression watch</category>
createExpWatchLeadString self createIvarLeadString.
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>probe finish</category>
createIndividualProbeLabel labelStream reset. labelStream nextPutAll: leadString; nextPutAll: actionString; nextPutAll: methodString. probeRecord characterIndex printOn: labelStream. probe labelString: labelStream contents. probe finishSetup.
createIndiviualProbeSmartExpression " We use label Stream, because it already exists, it should be called expressionStream." labelStream reset. labelStream nextPutAll: ' | stream | stream := WriteStream on: (String new: 100). stream nextPutAll: '''; nextPutAll: leadString; nextPutAll: actionString; nextPutAll: methodString; nextPutAll: '''. ThisProbe characterIndex printOn: stream. stream cr; nextPutAll: TopOFStack debugString. ^stream contents'. probe compileExpression: labelStream contents inClass: classUnderTest scope: startingScope.
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>simple watch</category>
createSimpleWatchTemplateProbe self createTemplateProbe.
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>smart watch</category>
createSmartWatchLeadString self createIvarLeadString
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>breakpoints</category>
initializeBreakpointLeadString leadString := ((#BreakOn1s << #pdp >> 'Break on - %<<1s>%> ') expandMacrosWith: iVarName).
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter <category>reporting</category>
report: basicType | reportStream | reportStream := WriteStream on: (String new: 200). reportStream nextPutAll: (self reportStringFor: basicType); nextPutAll: (#OnInstanceVariable << #pdp >> ' on instance variable <') asString; nextPutAll: iVarName; nextPutAll: (#ReferencesForC << #pdp >> '> references for:') asString; cr. instrumentationRecords do: [:rec | reportStream cr; nextPutAll: rec printString]. ComposedTextView open: reportStream contents asText asValue label: (#ProbeOnIVarRefsReport << #pdp >> 'Probe on Instance Variable References Report') icon: (Icon constantNamed: #workspace) extent: (500 @ 300).
</methods> <methods> CraftedSmalltalk.PDPIVarReferenceInstrumenter class <category>class initialization</category>
initialize reportStrings := Dictionary new. reportStrings at: #instrumentBreakpoint put: (#Breakpoint << #pdp >> 'Breakpoint') asString. reportStrings at: #instrumentSmartWatch put: (#SmartWatchpoint << #pdp >> 'Smart watchpoint') asString. reportStrings at: #instrumentSimpleWatch put: (#SimpleWatchpoint << #pdp >> 'Simple watchpoint') asString. reportStrings at: #instrumentNSimpleWatches put: (#NSimpleWatchpoints << #pdp >> 'N Simple watchpoints') asString. reportStrings at: #instrumentExpressionWatch put: (#ExpressionWatchpoint << #pdp >> 'Expression watchpoint') asString. "Smalltalk Professional Debug Package Version 1.5 (c) 1997 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.DisplayTOSProbe <category>responses</category>
actOn: aContext (self test: aContext) ifTrue: [PDPManager display: aContext top debugString on: windowID for: self]
</methods> <methods> CraftedSmalltalk.DisplayTOSProbe <category>initialize-release</category>
createLabelString labelString value: ((#TopOfStackAt1pIn2s << #pdp >> 'Top of Stack at <1p> in <2s>') expandMacrosWith: self characterIndex with: self methodString)
</methods> <methods> CraftedSmalltalk.DisplayTOSProbe <category>accessing</category>
editorLabelString ^(#EditTopOfStackWatchProbe << #pdp >> 'Edit Top of Stack Watch') asString
</methods> <methods> CraftedSmalltalk.ProbedCompiledBlock <category>private - probes</category>
addProbeToLiterals: aProbe | probeIndex | [probeIndex := (probeStart to: self size) detect: [:i | (self basicAt: i) == nil] ifNone: [nil]. probeIndex == nil] whileTrue: [self grow]. self basicAt: probeIndex put: aProbe. ^probeIndex
basicAddProbe: aProbe "Add aProbe to the receiver." | probeIndex | probeIndex := self addProbeToLiterals: aProbe. (self insertProbeBytecodesFor: probeIndex) ifTrue: [^self]. "A method branch limit was exceeded." BranchLimit raiseSignal.
basicIncludesProbe: targetProbe | probeIndex aProbe | probeIndex := probeStart. [aProbe := self basicAt: probeIndex. targetProbe = aProbe or: [probeIndex = self size]] whileFalse: [probeIndex := probeIndex + 1]. ^targetProbe = aProbe
basicRemoveProbe: aProbe "Add aProbe to the receiver." | probeIndex someProbe probeRecord pc newBytes segments | probeIndex := probeStart. [someProbe := self basicAt: probeIndex. aProbe = someProbe] whileFalse: [probeIndex := probeIndex + 1]. probeRecord := (self basicAt: probeIndex) probeRecord. self basicAt: probeIndex put: nil. "Make position empty." pc := probeRecord insertionPC. segments := JumpDecomposer new forMethod: self. self sourceMap do: [:me | me registerPCsWith: segments]. self probesDo: [:prb | prb probeRecord registerPCsWith: segments]. segments := segments decompose. segments do: [:seg | (pc between: seg oldBasePC and: seg oldBasePC+seg bytes size) ifTrue: [seg removeBytesAt: pc+1-seg oldBasePC size: probeRecord bytesInBytecodes segments: segments]]. newBytes := segments first class composeSegments: segments. bytes := (ByteArray new: newBytes size + 4) replaceFrom: 1 to: 4 with: bytes startingAt: 1. bytes replaceFrom: 5 to: bytes size with: newBytes startingAt: 1. bytes at: 4 put: (AuxCodeInfoExtractor new method: self; run; maxDepth).
insertProbeBytecodesFor: probeIndex | newBytes probeRecord pc fragment segments | probeRecord := (self basicAt: probeIndex) probeRecord. pc := probeRecord insertionPCFor: self. fragment := AssemblerCodeStream new initializeLiteralsFrom: self; pushConstant: (self basicAt: probeIndex); pushContext; sendNoCheck: #actOn: numArgs: 1; pop; bytes. segments := JumpDecomposer new forMethod: self. self sourceMap do: [:me | me registerPCsWith: segments]. self probesDo: [:aProbe | aProbe probeRecord registerPCsWith: segments]. segments := segments decompose. segments do: [:seg | (pc between: seg oldBasePC and: seg oldBasePC+seg bytes size) ifTrue: [seg insertBytesAt: pc+1-seg oldBasePC bytes: fragment for: probeRecord segments: segments]]. newBytes := [segments first class composeSegments: segments] on: ByteCodeStream branchLimitSignal do: [:x | ^false]. probeRecord bytesInBytecodes: fragment size. bytes := (ByteArray new: newBytes size + 4) replaceFrom: 1 to: 4 with: bytes startingAt: 1. bytes replaceFrom: 5 to: bytes size with: newBytes startingAt: 1. bytes at: 4 put: (AuxCodeInfoExtractor new method: self; run; maxDepth). ^true
probesDo: aBlock probeStart to: self size do: [:i | | aProbe | aProbe := self basicAt: i. aProbe == nil ifFalse: [aBlock value: aProbe]]
probeSize | count | count := 0. probeStart to: self basicSize do: [:i | (self basicAt: i) isNil ifFalse: [count := count + 1]]. ^count
</methods> <methods> CraftedSmalltalk.ProbedCompiledBlock <category>initialize-release</category>
copyFrom: oldSelf "Copy all the instance variable from oldSelf to the receiver. This is used to grow a new method." 1 to: oldSelf basicSize do: [ :i | self basicAt: i put: (oldSelf basicAt: i)]. 1 to: self class instSize do: [ :i | self instVarAt: i put: (oldSelf instVarAt: i)].
from: aCompiledBlock "Recursively create a new ProbedCompiledBlock from aCompliedBlock." | flags | probeStart := aCompiledBlock numLiterals + 2. self at: probeStart - 1 put: #actOn:. 1 to: aCompiledBlock numLiterals do: [:i | | lit cl bm | lit := aCompiledBlock literalAt: i. cl := lit class. cl == CompiledBlock ifTrue: [self literalAt: i put: (lit := ProbedCompiledBlock from: lit). lit outerMethod: self] ifFalse: [cl == BlockClosure ifTrue: [self literalAt: i put: (lit := lit copy). bm := ProbedCompiledBlock from: lit method. lit method: bm. bm outerMethod: self] ifFalse: [self literalAt: i put: lit]]]. flags := 16rE0 + (aCompiledBlock usesContextInstVars ifTrue: [16] ifFalse: [0]). bytes := (ByteArray with: flags with: aCompiledBlock numArgs with: aCompiledBlock numTempsOnly with: aCompiledBlock frameSize) , aCompiledBlock bytes. ^self
grow | newSelf | newSelf := self class new: self basicSize + 7. newSelf copyFrom: self. newSelf become: self
</methods> <methods> CraftedSmalltalk.ProbedCompiledBlock <category>testing</category>
basicHasAnyProbes ^(probeStart to: self size) anySatisfy: [:i | (self basicAt: i) notNil]
isProbed ^true
</methods> <methods> CraftedSmalltalk.ProbedCompiledBlock <category>accessing</category>
sourceMap ^self homeMethod methodHolder sourceMap at: self blockMethodIndex
variableMap ^self homeMethod methodHolder variableMap at: self blockMethodIndex
</methods> <methods> CraftedSmalltalk.ProbedCompiledBlock <category>copying</category>
basicMethodDcopyUsing: copyDict ^self basicDcopyUsing: copyDict
postDcopyUsing: copyDict outerMethod := outerMethod basicDcopyUsing: copyDict. 1 to: self basicSize do: [ :i | self basicAt: i put: ((self basicAt: i) basicMethodDcopyUsing: copyDict)]
</methods> <methods> CraftedSmalltalk.ProbedCompiledBlock class <category>instance creation</category>
from: aCompiledBlockMethod ^(self new: aCompiledBlockMethod basicSize + 7) from: aCompiledBlockMethod "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.MethodActionRecord <category>initialize-release</category>
action: anInteger class: aClass selector: aSymbol action := anInteger. class := aClass. selector := aSymbol
</methods> <methods> CraftedSmalltalk.MethodActionRecord <category>accessing</category>
compiledMethod ^class compiledMethodAt: selector
methodClass ^class
methodClass: aClass class := aClass
nameString ^class shortName , '>>' , selector
printString action == nil ifTrue: [^self nameString]. ^(#('r' 'rw' 'w') at: action) , ' ' , class shortName , '>>' , selector
replaceMethod: aCompiledMethod class addSelector: selector withMethod: aCompiledMethod
setRead action := #r
setReadWrite action := #rw
setWrite action := #w
</methods> <methods> CraftedSmalltalk.MethodActionRecord <category>testing</category>
isRead ^action < 3
isWrite ^action > 1
</methods> <methods> CraftedSmalltalk.MethodActionRecord class <category>instance creation</category>
action: anInteger class: aClass selector: aSymbol ^self new action: anInteger class: aClass selector: aSymbol "Smalltalk Professional Debug Package Version 1.10 (c) 1995 Crafted Smalltalk"
</methods> <methods> CraftedSmalltalk.ActionProbeEditor <category>accessing</category>
actionEditor actionEditor == nil ifFalse: [^actionEditor]. actionEditor := ProbeActionExpressionEditor new probe: workingCopyProbe on: probedMethod class: probedClass. ^actionEditor
</methods> <methods> CraftedSmalltalk.ActionProbeEditor <category>interface opening</category>
createEditor ^self createEditorOn: #actionEditorSpec
</methods> <methods> CraftedSmalltalk.ProbeCharacterStyle <category>testing</category>
isCharStyleCacheable ^false
</methods> <methods> Kernel.MethodInfoRecord <category>copying</category>
postDcopyUsing: copyDict "Complete the deep copy operation. We don't copy bindings." completeMap := completeMap basicDcopyUsing: copyDict. topNode := topNode basicDcopyUsing: copyDict.
</methods> <methods> CraftedSmalltalk.PDPMsgRcvdInstrumenterGUIModel class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #ProbeOnMessageReceived #defaultString: 'Probe on message received' #catalogID: #pdp) #min: #(#Point 611 505 ) #bounds: #(#Rectangle 466 505 1077 1040 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 6 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #ProbeOnMessageReceived #defaultString: 'Probe on message received' #catalogID: #pdp) ) #(#SequenceViewSpec #layout: #(#LayoutFrame 20 0 32 0 -217 1 -56 1 ) #model: #listModel #multipleSelections: true #useModifierKeys: true #selectionType: #highlight ) #(#CompositeSpecCollection #collection: #( #(#ActionButtonSpec #layout: #(#Rectangle 0 0 80 25 ) #model: #finishUp #label: #(#{Kernel.UserMessage} #key: #Done #defaultString: 'Done' #catalogID: #pdp) #isDefault: true #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 154 0 234 25 ) #model: #closeRequest #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#AlignmentOrigin 0 0.5 -40 1 0.5 0 ) ) ) #(#CompositeSpecCollection #collection: #( #(#MenuButtonSpec #layout: #(#Rectangle 0 131 177 156 ) #name: #ivarMenu #model: #ivarMenuModel #label: #(#{Kernel.UserMessage} #key: #Select #defaultString: 'Select' #catalogID: #pdp) #menu: #ivarMenu #flags: 40) #(#CheckBoxSpec #layout: #(#Point 0 0 ) #model: #subclassModel #label: #(#{Kernel.UserMessage} #key: #IncludeSubclasses #defaultString: 'Include Subclasses' #catalogID: #pdp) ) #(#LabelSpec #layout: #(#Point 0 28 ) #label: #(#{Kernel.UserMessage} #key: #TypeOfAction #defaultString: 'Type of Action' #catalogID: #pdp) ) #(#RadioButtonSpec #layout: #(#Point 0 53 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #Breakpoint #defaultString: 'Breakpoint' #catalogID: #pdp) #select: #instrumentBreakpoint ) #(#RadioButtonSpec #layout: #(#Point 0 78 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #SimpleMsgTrace #defaultString: 'Simple Msg Trace' #catalogID: #pdp) #select: #instrumentSmartWatch ) #(#RadioButtonSpec #layout: #(#Point 0 103 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #IvarWatch #defaultString: 'Ivar Watch' #catalogID: #pdp) #select: #instrumentSimpleWatch ) #(#RadioButtonSpec #layout: #(#Point 0 168 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #ExpressionWatch #defaultString: 'Expression Watch' #catalogID: #pdp) #select: #instrumentExpressionWatch ) #(#CheckBoxSpec #layout: #(#Point 0 215 ) #model: #conditionalModel #label: #(#{Kernel.UserMessage} #key: #Conditional #defaultString: 'Conditional' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 254 ) #name: #winParam #model: #winParamModel #label: #(#{Kernel.UserMessage} #key: #WindowParameters #defaultString: 'Window Parameters' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 279 ) #model: #reportModel #label: #(#{Kernel.UserMessage} #key: #GenerateReport #defaultString: 'Generate report' #catalogID: #pdp) ) #(#ActionButtonSpec #layout: #(#Rectangle 0 317 108 341 ) #model: #help #label: #(#{Kernel.UserMessage} #key: #Help #defaultString: 'Help' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#LayoutFrame -197 1 32 0 -20 1 373 0 ) ) ) ) ) )
</methods> <methods> CraftedSmalltalk.ProbeTestExpressionEditor class <category>interface specs</category>
testEditorSpec "Tools.UIPainter new openOnClass: self andSelector: #testEditorSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #UnlabeledCanvas #defaultString: 'Unlabeled Canvas' #catalogID: #pdp ) #bounds: #(#{Graphics.Rectangle} 720 450 1316 877 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TextEditorSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 30 0 0 1 0 1 ) #name: #textEditor #model: #editor #menu: #textMenu #performer: #editor #tabRequiresControl: true ) #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0 30 0 0 1 ) #name: #testEditor #label: #(#{Kernel.UserMessage} #key: #TriggerConditionC #defaultString: 'Trigger Condition:' #catalogID: #pdp ) ) ) ) )
</methods> <methods> CraftedSmalltalk.PDPIVarRefInstrumenterGUIModel class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #ProbeOnInstanceVariableReference #defaultString: 'Probe on instance variable reference' #catalogID: #pdp) #min: #(#Point 611 504 ) #bounds: #(#Rectangle 449 338 1060 873 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 6 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #ProbeOnInstanceVariableReference #defaultString: 'Probe on instance variable reference' #catalogID: #pdp) ) #(#SequenceViewSpec #layout: #(#LayoutFrame 20 0 33 0 -220 1 -55 1 ) #model: #listModel #multipleSelections: true #useModifierKeys: true #selectionType: #highlight ) #(#CompositeSpecCollection #collection: #( #(#ActionButtonSpec #layout: #(#Rectangle 0 0 80 25 ) #model: #finishUp #isDefault: true #label: #(#{Kernel.UserMessage} #key: #Done #defaultString: 'Done' #catalogID: #pdp) #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 154 0 234 25 ) #model: #closeRequest #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#AlignmentOrigin 0 0.5 -40 1 0.5 0 ) ) ) #(#CompositeSpecCollection #collection: #( #(#LabelSpec #layout: #(#Point 0 0 ) #label: #(#{Kernel.UserMessage} #key: #SelectedInstanceVariable #defaultString: 'Selected Instance Variable' #catalogID: #pdp) ) #(#MenuButtonSpec #layout: #(#Rectangle 0 22 177 47 ) #name: #ivarMenu #model: #ivarMenuModel #label: #(#{Kernel.UserMessage} #key: #Select #defaultString: 'Select' #catalogID: #pdp) #menu: #ivarMenu ) #(#CheckBoxSpec #layout: #(#Point 0 56 ) #model: #readModel #label: #(#{Kernel.UserMessage} #key: #OnRead #defaultString: 'On Read' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 81 ) #model: #writeModel #label: #(#{Kernel.UserMessage} #key: #OnWrite #defaultString: 'On Write' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 106 ) #model: #subclassModel #label: #(#{Kernel.UserMessage} #key: #IncludeSubclasses #defaultString: 'Include Subclasses' #catalogID: #pdp) ) #(#LabelSpec #layout: #(#Point 0 139 ) #label: #(#{Kernel.UserMessage} #key: #TypeOfAction #defaultString: 'Type of Action' #catalogID: #pdp) ) #(#RadioButtonSpec #layout: #(#Point 0 164 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #Breakpoint #defaultString: 'Breakpoint' #catalogID: #pdp) #select: #instrumentBreakpoint ) #(#RadioButtonSpec #layout: #(#Point 0 189 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #SmartWatch #defaultString: 'Smart Watch' #catalogID: #pdp) #select: #instrumentSmartWatch ) #(#RadioButtonSpec #layout: #(#Point 0 214 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #SimpleWatch #defaultString: 'Simple Watch' #catalogID: #pdp) #select: #instrumentSimpleWatch ) #(#RadioButtonSpec #layout: #(#Point 0 239 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #NSimpleWatches #defaultString: 'N Simple Watches' #catalogID: #pdp) #select: #instrumentNSimpleWatches ) #(#RadioButtonSpec #layout: #(#Point 0 264 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #ExpressionWatch #defaultString: 'Expression Watch' #catalogID: #pdp) #select: #instrumentExpressionWatch ) #(#CheckBoxSpec #layout: #(#Point 0 289 ) #model: #conditionalModel #label: #(#{Kernel.UserMessage} #key: #Conditional #defaultString: 'Conditional' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 328 ) #name: #winParam #model: #winParamModel #label: #(#{Kernel.UserMessage} #key: #WindowParameters #defaultString: 'Window Parameters' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 353 ) #model: #reportModel #label: #(#{Kernel.UserMessage} #key: #GenerateReport #defaultString: 'Generate report' #catalogID: #pdp) ) #(#ActionButtonSpec #layout: #(#Rectangle 0 391 108 415 ) #model: #help #label: #(#{Kernel.UserMessage} #key: #Help #defaultString: 'Help' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#LayoutFrame -197 1 33 0 -20 1 448 0 ) ) ) ) ) )
</methods> <methods> CraftedSmalltalk.RemovedProbedMethodsBrowser class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #RemovedProbedMethods #defaultString: 'Removed Probed Methods' #catalogID: #pdp) #bounds: #(#Rectangle 422 622 958 1068 ) ) #component: #(#SpecCollection #collection: #( #(#SequenceViewSpec #layout: #(#LayoutFrame 0 0 0 0 0 1 0 0.3 ) #model: #methodList #menu: #menuHolder #multipleSelections: true #useModifierKeys: true #selectionType: #highlight ) #(#TextEditorSpec #layout: #(#LayoutFrame 0 0 0 0.3 0 1 0 1 ) #model: #textHolder ) ) ) )
</methods> <methods> CraftedSmalltalk.CodeProbeEditor class <category>interface specs</category>
testEditorSpec "Tools.UIPainter new openOnClass: self andSelector: #testEditorSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #ProbeEditor #defaultString: 'Probe Editor' #catalogID: #pdp ) #min: #(#{Core.Point} 462 301 ) #bounds: #(#{Graphics.Rectangle} 730 422 1326 849 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -220 1 -35 1 -120 1 -10 1 ) #model: #accept #label: #(#{Kernel.UserMessage} #key: #OK #defaultString: 'OK' #catalogID: #pdp ) #defaultable: true ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -110 1 -35 1 -10 1 -10 1 ) #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp ) #defaultable: true ) #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 10 0 0 0 -10 1 -45 1 ) #flags: 0 #majorKey: #{CraftedSmalltalk.ProbeTestExpressionEditor} #minorKey: #testEditorSpec #clientKey: #testEditor ) ) ) )
</methods> <methods> CraftedSmalltalk.ProbeActionExpressionEditor class <category>interface specs</category>
watchExpressionEditorSpec "Tools.UIPainter new openOnClass: self andSelector: #watchExpressionEditorSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #UnlabeledCanvas #defaultString: 'Unlabeled Canvas' #catalogID: #pdp ) #bounds: #(#{Graphics.Rectangle} 732 439 1328 866 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TextEditorSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 30 0 0 1 0 1 ) #name: #textEditor #model: #editor #menu: #textMenu #performer: #editor #tabRequiresControl: true ) #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0 30 0 0 1 ) #name: #actionEditor #label: #(#{Kernel.UserMessage} #key: #WatchExpressionC #defaultString: 'Watch Expression:' #catalogID: #pdp ) ) ) ) )
</methods> <methods> CraftedSmalltalk.PDPMthdListMsgRcvdInstrumenterGUIModel class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #ProbeOnMessageReceived #defaultString: 'Probe on message received' #catalogID: #pdp) #min: #(#Point 611 505 ) #bounds: #(#Rectangle 466 505 1077 1040 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 6 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #ProbeOnMessageReceived #defaultString: 'Probe on message received' #catalogID: #pdp) ) #(#SequenceViewSpec #layout: #(#LayoutFrame 20 0 32 0 -217 1 -56 1 ) #model: #listModel #multipleSelections: true #useModifierKeys: true #selectionType: #highlight ) #(#CompositeSpecCollection #collection: #( #(#ActionButtonSpec #layout: #(#Rectangle 0 0 80 25 ) #model: #finishUp #label: #(#{Kernel.UserMessage} #key: #Done #defaultString: 'Done' #catalogID: #pdp) #isDefault: true #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 154 0 234 25 ) #model: #closeRequest #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#AlignmentOrigin 0 0.5 -40 1 0.5 0 ) ) ) #(#CompositeSpecCollection #collection: #( #(#MenuButtonSpec #layout: #(#Rectangle 0 131 177 156 ) #name: #ivarMenu #model: #ivarMenuModel #label: #(#{Kernel.UserMessage} #key: #Select #defaultString: 'Select' #catalogID: #pdp) #menu: #ivarMenu #flags: 40) #(#LabelSpec #layout: #(#Point 0 28 ) #label: #(#{Kernel.UserMessage} #key: #TypeOfAction #defaultString: 'Type of Action' #catalogID: #pdp) ) #(#RadioButtonSpec #layout: #(#Point 0 53 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #Breakpoint #defaultString: 'Breakpoint' #catalogID: #pdp) #select: #instrumentBreakpoint ) #(#RadioButtonSpec #layout: #(#Point 0 78 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #SimpleMsgTrace #defaultString: 'Simple Msg Trace' #catalogID: #pdp) #select: #instrumentSmartWatch ) #(#RadioButtonSpec #layout: #(#Point 0 103 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #IvarWatch #defaultString: 'Ivar Watch' #catalogID: #pdp) #select: #instrumentSimpleWatch ) #(#RadioButtonSpec #layout: #(#Point 0 168 ) #model: #basicTypeModel #label: #(#{Kernel.UserMessage} #key: #ExpressionWatch #defaultString: 'Expression Watch' #catalogID: #pdp) #select: #instrumentExpressionWatch ) #(#CheckBoxSpec #layout: #(#Point 0 215 ) #model: #conditionalModel #label: #(#{Kernel.UserMessage} #key: #Conditional #defaultString: 'Conditional' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 254 ) #name: #winParam #model: #winParamModel #label: #(#{Kernel.UserMessage} #key: #WindowParameters #defaultString: 'Window Parameters' #catalogID: #pdp) ) #(#CheckBoxSpec #layout: #(#Point 0 279 ) #model: #reportModel #label: #(#{Kernel.UserMessage} #key: #GenerateReport #defaultString: 'Generate report' #catalogID: #pdp) ) #(#ActionButtonSpec #layout: #(#Rectangle 0 317 108 341 ) #model: #help #label: #(#{Kernel.UserMessage} #key: #Help #defaultString: 'Help' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#LayoutFrame -197 1 32 0 -20 1 373 0 ) ) ) ) ) )
</methods> <methods> CraftedSmalltalk.PDPManager class <category>interface specs</category>
aboutSpec "UIPainter new openOnClass: self andSelector: #aboutSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #properties: #(#{UI.PropertyListDictionary} #sizeType #specifiedSize #positionType #screenCenter #openType #advanced ) #label: #(#{Kernel.UserMessage} #key: #AboutSPDP #defaultString: 'About SPDP' #catalogID: #pdp) #min: #(#{Core.Point} 319 180 ) #max: #(#{Core.Point} 319 180 ) #bounds: #(#{Graphics.Rectangle} 644 506 963 686 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0.5 5 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #SmalltalkProfessionalDebugPackage #defaultString: 'Smalltalk Professional Debug Package' #catalogID: #pdp) ) #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0.5 30 0 0.5 0 ) #label: #versionLabel ) #(#{UI.ActionButtonSpec} #layout: #(#{UI.AlignmentOrigin} 0 0.5 140 0 0.5 0 ) #model: #ok #label: #(#{Kernel.UserMessage} #key: #Ok #defaultString: 'Ok' #catalogID: #pdp) #isDefault: true #defaultable: true ) #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0.5 58 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #Copyright2002CraftedSmalltalk #defaultString: 'Copyright 2002, Crafted Smalltalk ' #catalogID: #pdp) ) #(#{UI.LabelSpec} #layout: #(#{Core.Point} 64 90 ) #label: #(#{Kernel.UserMessage} #key: #EmailCTraymondcraftedsmalltalkcom #defaultString: 'Email: traymond@craftedsmalltalk.com' #catalogID: #pdp) ) ) ) )
</methods> <methods> CraftedSmalltalk.PDPTransientWarning class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #Warning #defaultString: 'Warning' #catalogID: #pdp) #bounds: #(#Rectangle 469 621 773 725 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 0 0.5 0.5 0.5 ) #name: #warning #label: #(#{Kernel.UserMessage} #key: #warning #defaultString: 'warning' #catalogID: #pdp) ) ) ) )
</methods> <methods> CraftedSmalltalk.DisplayProbeEditor class <category>interface specs</category>
displayEditorSpec "Tools.UIPainter new openOnClass: self andSelector: #displayEditorSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #ProbeEditor #defaultString: 'Probe Editor' #catalogID: #pdp ) #min: #(#{Core.Point} 522 374 ) #bounds: #(#{Graphics.Rectangle} 720 450 1242 824 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 10 0 0 0 -180 1 -65 1 ) #flags: 0 #majorKey: #{CraftedSmalltalk.ProbeTestExpressionEditor} #minorKey: #testEditorSpec #clientKey: #testEditor ) #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} -160 1 10 0 0 1 241 0 ) #flags: 0 #majorKey: #{CraftedSmalltalk.DisplayProbeEditor} #minorKey: #windowParamSpec ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -220 1 -45 1 -120 1 -15 1 ) #model: #accept #label: #(#{Kernel.UserMessage} #key: #OK #defaultString: 'OK' #catalogID: #pdp ) #defaultable: true ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -110 1 -45 1 -10 1 -15 1 ) #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp ) #defaultable: true ) ) ) )
windowParamSpec "UIPainter new openOnClass: self andSelector: #windowParamSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #bounds: #(#Rectangle 578 310 725 471 ) ) #component: #(#SpecCollection #collection: #( #(#CompositeSpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.506944 0 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #WindowID #defaultString: 'Window ID' #catalogID: #pdp) ) #(#InputFieldSpec #layout: #(#Rectangle 0 24 144 54 ) #name: #idEntry #model: #windowID ) #(#ActionButtonSpec #layout: #(#Rectangle 0 60 144 90 ) #model: #selectID #label: #(#{Kernel.UserMessage} #key: #SelectIDDots #defaultString: 'Select ID...' #catalogID: #pdp) #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 0 96 144 126 ) #model: #openWatchWindow #label: #(#{Kernel.UserMessage} #key: #OpenWindow #defaultString: 'Open Window' #catalogID: #pdp) #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 0 132 144 162 ) #model: #changeLabel #label: #(#{Kernel.UserMessage} #key: #ChangeLabel #defaultString: 'Change label' #catalogID: #pdp) #defaultable: true ) ) #compositeSpec: #(#CompositeSpec #layout: #(#Rectangle 1 -5 145 157 ) ) ) ) ) )
windowParmOpenSpec "UIPainter new openOnClass: self andSelector: #windowParmOpenSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #WindowParameters #defaultString: 'Window Parameters' #catalogID: #pdp) #bounds: #(#Rectangle 975 471 1236 761 ) ) #component: #(#SpecCollection #collection: #( #(#ActionButtonSpec #layout: #(#LayoutFrame -40 0.3 -45 1 40 0.3 -15 1 ) #model: #accept #label: #(#{Kernel.UserMessage} #key: #Done #defaultString: 'Done' #catalogID: #pdp) #defaultable: true ) #(#SubCanvasSpec #layout: #(#LayoutFrame -75 0.5 48 0 75 0.5 217 0 ) #flags: 0 #majorKey: #DisplayProbeEditor #minorKey: #windowParamSpec ) #(#ActionButtonSpec #layout: #(#LayoutFrame -40 0.7 -45 1 40 0.7 -15 1 ) #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp) #defaultable: true ) #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 11 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #SelectWindowParameters #defaultString: 'Select Window Parameters' #catalogID: #pdp) ) ) ) )
</methods> <methods> CraftedSmalltalk.ActionProbeEditor class <category>interface specs</category>
actionEditorSpec "Tools.UIPainter new openOnClass: self andSelector: #actionEditorSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #ProbeEditor #defaultString: 'Probe Editor' #catalogID: #pdp ) #min: #(#{Core.Point} 494 500 ) #bounds: #(#{Graphics.Rectangle} 737 348 1231 848 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 10 0 0 0 -180 1 -10 0.5 ) #flags: 0 #majorKey: #{CraftedSmalltalk.ProbeTestExpressionEditor} #minorKey: #testEditorSpec #clientKey: #testEditor ) #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 10 0 -10 0.5 -180 1 -60 1 ) #flags: 0 #majorKey: #{CraftedSmalltalk.ProbeActionExpressionEditor} #minorKey: #watchExpressionEditorSpec #clientKey: #actionEditor ) #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} -170 1 10 0 0 1 255 0 ) #flags: 0 #majorKey: #{CraftedSmalltalk.DisplayProbeEditor} #minorKey: #windowParamSpec ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -220 1 -45 1 -120 1 -15 1 ) #model: #accept #label: #(#{Kernel.UserMessage} #key: #OK #defaultString: 'OK' #catalogID: #pdp ) #defaultable: true ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -110 1 -45 1 -10 1 -15 1 ) #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #pdp ) #defaultable: true ) ) ) )
</methods> <initialize> CraftedSmalltalk.AbstractCodeProbe </initialize> <initialize> CraftedSmalltalk.PDPWeakDictionary </initialize> <initialize> CraftedSmalltalk.BreakInterrupt </initialize> <initialize> CraftedSmalltalk.PDPMsgRcvdInstrumenter </initialize> <initialize> CraftedSmalltalk.ProbedCompiledMethod </initialize> <initialize> CraftedSmalltalk.CRC32Function </initialize> <initialize> CraftedSmalltalk.PDPManager </initialize> <initialize> CraftedSmalltalk.PDPIVarReferenceInstrumenter </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>CompiledBlock</name> <environment>Kernel</environment> <super>Kernel.CompiledCode</super> <private>false</private> objects outerMethod <imports> private Kernel.OpcodePool.* </imports> <category>Kernel-Methods</category> <attributes> <package>Kernel-Methods</package> </attributes> </class> <class> <name>VariableDefinition</name> <environment>Kernel</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>System-Compiler-Names and Scopes</category> <attributes> <package>System-Compiler-Names and Scopes</package> </attributes> </class> <class> <name>RemoteVariable</name> <environment>Kernel</environment> <super>Kernel.VariableDefinition</super> <private>false</private> none contextNode index <imports></imports> <category>System-Compiler-Names and Scopes</category> <attributes> <package>System-Compiler-Names and Scopes</package> </attributes> </class> <class> <name>TextCollectorView</name> <environment>UI</environment> <super>UI.ComposedTextView</super> <private>false</private> none appendEntryMutex <imports></imports> <category>UIBasics-Components</category> <attributes> <package>UIBasics-Components</package> </attributes> </class> <class> <name>MethodInfoRecord</name> <environment>Kernel</environment> <super>Core.Object</super> <private>false</private> none bindings completeMap topNode <imports></imports> <category>System-Compiler-Support</category> <attributes> <package>System-Compiler-Support</package> </attributes> </class> <class> <name>ApplicationModel</name> <environment>UI</environment> <super>UI.Model</super> <private>false</private> none builder uiSession eventHandlers savedWindowInformation <imports></imports> <category>UIBuilder-Framework</category> <attributes> <package>UIBuilder-Framework</package> </attributes> </class> <class> <name>GenericException</name> <environment>Core</environment> <super>Core.Object</super> <private>false</private> none messageText originator initialContext firstUnwindContext handlerContext parameter proceedBlock isResumable signal searchContext notifierString <imports></imports> <category>Kernel-Exception Handling</category> <attributes> <package>Kernel-Exception Handling</package> </attributes> </class> <class> <name>Error</name> <environment>Core</environment> <super>Core.Exception</super> <private>false</private> none <imports></imports> <category>Kernel-Exception Handling</category> <attributes> <package>Kernel-Exception Handling</package> </attributes> </class> <class> <name>BlockClosure</name> <environment>Kernel</environment> <super>Core.Object</super> <private>false</private> none method outerContext copiedValues <imports></imports> <category>Kernel-Methods</category> <attributes> <package>Kernel-Methods</package> </attributes> </class> <class> <name>InstructionStream</name> <environment>Kernel</environment> <super>Kernel.InstructionClient</super> <private>false</private> none method pc <imports> private Kernel.OpcodePool.* </imports> <category>Kernel-Methods</category> <attributes> <package>Kernel-Methods</package> </attributes> </class> <class> <name>CompilerErrorHandler</name> <environment>Kernel</environment> <super>Core.Object</super> <private>false</private> none failBlock retryBlock class selector errorHandlers environment <imports></imports> <category>System-Compiler-Support</category> <attributes> <package>System-Compiler-Support</package> </attributes> </class> <class> <name>Collection</name> <environment>Core</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Collections-Abstract</category> <attributes> <package>Collections-Abstract</package> </attributes> </class> <class> <name>SimpleDialog</name> <environment>UI</environment> <super>UI.ApplicationModel</super> <private>false</private> none close accept cancel preBuildBlock postBuildBlock postOpenBlock escapeIsCancel parentView <imports></imports> <category>Interface-Dialogs</category> <attributes> <package>Interface-Dialogs</package> </attributes> </class> <class> <name>ControlInterrupt</name> <environment>Core</environment> <super>Core.GenericException</super> <private>false</private> none isInterrupt <imports></imports> <category>Kernel-Exception Handling</category> <attributes> <package>Kernel-Exception Handling</package> </attributes> </class> <class> <name>Parser</name> <environment>Kernel</environment> <super>Kernel.Scanner</super> <private>false</private> none builder requestor oldLanguage newLanguage extendedLanguage parseNode failBlock endTemps targetClass environment topEnvironment bindingRefs <imports></imports> <category>System-Compiler-Public Access</category> <attributes> <package>System-Compiler-Public Access</package> </attributes> </class> <class> <name>Association</name> <environment>Core</environment> <super>Core.LookupKey</super> <private>false</private> none value <imports></imports> <category>Collections-Support</category> <attributes> <package>Collections-Support</package> </attributes> </class> <class> <name>CompiledMethod</name> <environment>Kernel</environment> <super>Kernel.CompiledMainBlock</super> <private>false</private> objects mclass sourceCode <imports> private Kernel.OpcodePool.* </imports> <category>Kernel-Methods</category> <attributes> <package>Kernel-Methods</package> </attributes> </class> <class> <name>TextCollector</name> <environment>UI</environment> <super>UI.ValueHolder</super> <private>false</private> none entryStream characterLimit writeSequencer nextEntry autoFlush <imports></imports> <category>Interface-Support</category> <attributes> <package>Interface-Support</package> </attributes> </class> <class> <name>Compiler</name> <environment>Kernel</environment> <super>Kernel.SmalltalkCompiler</super> <private>false</private> none <imports></imports> <category>System-Compiler-Public Access</category> <attributes> <package>System-Compiler-Public Access</package> </attributes> </class>