hpi-swa-lab / squeak-tracedebugger

A lightweight and interactive back-in-time debugger for Squeak to trace and retrace past method invocations and state changes. Powered by SimulationStudio.
https://hpi-swa-lab.github.io/squeak-tracedebugger/
MIT License
6 stars 0 forks source link

`TDBProxy` limitation: Retracing of side effects will not continue after return #62

Open LinqLover opened 2 years ago

LinqLover commented 2 years ago

Example:

array := Array streamContents: [:s|
    aTdbProxyForAnArray do: [:ea | s nextPut: ea]].
array first someState.

One might expect that the element arrays would be further TDBProxys after executing this snippet, or that the entire handling of the array would be continued in the retracing simulator. However, none of this is currently the case and the final expression accesses the current version of the item's state instead of its historic state. Hypothetically related if we wanted to go the second route: https://github.com/LinqLover/SimulationStudio/issues/51

At the moment, a workaround is to wrap the entire expression with a message send to the proxy, e.g.:

aTdbProxyForAnArray in: [:theTdbProxyForAnArray |
    array := Array streamContents: [:s|
        theTdbProxyForAnArray do: [:ea | s nextPut: ea]].
    array first someState].

Maybe we should at least document this pattern somewhere.

See TDBObjectExplorerWrapper>>#contents for a real motivating example.