hpi-swa / MessageSendRecorder

Tracing tool for Squeak/Smalltalk. Includes a debugger-like browser for records.
MIT License
10 stars 2 forks source link

Feature Request: API for adding before/after blocks #4

Open LinqLover opened 4 years ago

LinqLover commented 4 years ago

Something like this:

MessageSendRecorder new
    watchPackageNamed: #Morphic;
    setMessageSend: [m fullBounds];
    setBefore: {} after: {[:record :rcvr | record halt extent: b extent]};
    recordAllObjects;
    browse

is not going to work as one might expect at the moment. MSR is lacking some protocol such as #addBefore: aBlock and #addAfter: aBlock. This would also be more convenient if you do not want to set both blocks at once.

marceltaeumel commented 3 years ago

The example you provided does work, right? It uses #setBefore:after:. Maybe I don't understand your description correctly.

LinqLover commented 3 years ago

Sorry for the bad description. #setBefore:after: removes any previously added blocks. The given example overrides all existing blocks in #setRecordAllObjects. I am seeking for a protocol that allows me to sequentially add new blocks to the recorder without removing existing ones.