Occasionally, it is necessary to create your own customized probe library. As installed, the system has a probe library facility but it may be too general for your needs. This facility, which is available on the Launcher->Debug menu, enables the user to store probes in a file and later load those probes.
However, there may be situations where you would like the probe library to be maintained by source code control. The process of doing this is pretty simple.
- Remove all probes from the system.
- Create your special probes using the probe editor.
- Save your probes to a file using Debug->Probe Library->Save…
- Create a method to return probe save string, as follows;
probeSaveString ^'FileBrowser>>text CRC: 1512475320 Probes: 1 ProbeType: CodeProbe CharacterPosition: 124 LabelString: ''Break in FileBrowser>>text at 124'' Variables: 0 TestExpr: ''Transcript show: ''''foo'''';cr. ^false'' '
5. Now create a method to install the probes as follows;
ProbeCompiledMethod probeMethodsFrom: self probeSaveString readStream.
Because of the difficulty in properly quoting strings in a method it is better to let the system do it for you. In a workspace do a printIt, using a similar expression as below, and copy the resulting string into your method;
'probLibTest.prb' asFilename readStream contents
One other thing you need to be aware of is that if your method changes and you attempt to load a probe library, the load will fail. Detection of the method change is done by comparing the CRC value.