undoio / delve

Fork of go-delve debugger with UndoDB support.
MIT License
5 stars 0 forks source link

Undo v1.20.2-3 + session checkpoints #41

Closed mark-undoio closed 1 year ago

mark-undoio commented 1 year ago

Extend previous work on the restart command and checkpoint facilities to support save/load of sessions in a compatible format to UDB.

This PR introduces the concept of an undoSession object, which stores checkpoints and is provided as a context for resolving user-specified times. This enables it to do appropriate look-up for checkpoints when required and gives us a home for session-management (such as saving and loading the JSON file).

mark-undoio commented 1 year ago

@gareth-rees I'm adding some additional commentary.

I'll layer on an additional commit for the checkpoint naming stuff, since naming is part of the original fork (and thus we'll want to squash the fix down into the patchset later).

For the isUndoServer vs undoSession - I've always been unhappy with this split but haven't yet figured out how to deal with it. I think it's a bit of a can of worms.

The gdbConn level currently needs to know if we're an Undo server but can't access gdbProcess.undoSession. I think can attach most of the state down into the gdbConn layer instead if we wanted but I'm undecided whether that makes sense in terms of the layering - maybe.

We will still be storing some Undo state in the gdbProcess even then, since we cheekily store the recording filename in the gdbProcess.tracedir directory. That might be the least bad option

mark-undoio commented 1 year ago

@gareth-rees I think I've addressed all the stuff I'm intending to get into right now - which was most of it. I'm intending to merge with your existing approval but can revisit anything if there are mistakes / misunderstandings in my implementation of these changes.

I snuck an extra fix (zero-argument handling of the "restart" command) in here but I don't think it needs review as it's really very small.

mark-undoio commented 1 year ago

This was released as part of undo-v1.20-4.