Skip to content

Undo v1.23.1 #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: upstream-v1.23.1
Choose a base branch
from
Draft

Undo v1.23.1 #47

wants to merge 19 commits into from

Conversation

mark-undoio
Copy link
Contributor

@mark-undoio mark-undoio commented Nov 11, 2024

Work-in-progress update of Undo's Delve support to v1.23.1, bringing us in line with upstream's latest.

Note that some accompanying changes to udbserver (to support new Delve behaviours) and the Undo Engine (to support new Go standard library behaviours) are required for this to work.

gareth-rees and others added 14 commits November 7, 2024 19:33
In Undo, debuggee state is immutable during replay, so reading the G
pointer via code injection won't work; and in any case, this approach
is simpler.
* Update the documentation to mention UDB or LiveRecorder alongside rr.
* Add makefile support for testing the Undo backend.
* Add DLV_RECORD_REPLAY_BACKEND environment variable which overrides
  the record-replay backend, for use in GoLand.
* Implement checkpoints as a map from checkpoint number to time.
* Suppress resume call after restart.
* Implement "when" command using "get_time" serial command.
* Implement call injection using "set_debuggee_volatile".
* Implement "restart" using "goto_time".
* Enable or disable Undo backend appropriately in test cases.
This fixes a bug in which it was not possible to reverse debug after a stepping
operation e.g. next encountered the end of recorded history.
The error handling here was a bit painful but only needs doing in these two
places (for now).
This is made compatible with UDB's bookmarks by using the UDB bookmark name as
the "Note" field in Delve. To save Delve checkpoints, the "Note" must be made
unique, so as to be a valid bookmark name in UDB.
This avoids us creating an invalid JSON file when the content we're writing out
is smaller than the previous contents.
This updates the start-up of the replay session to obtain the local path to the
debuggee binary, which Delve wants to look up symbol information.

By doing this, it's possible to debug a recording even when the original binary
is no longer present or was at a different path on the machine that created the
recording.
Otherwise a backwards continue to the start of time does not emit the expected
"stop" packet, causing the debugger to loop forever.
@mark-undoio mark-undoio marked this pull request as draft November 11, 2024 17:27
@@ -512,7 +512,8 @@ func UndoIsAvailable() error {

for _, cmd := range cmds {
if _, err := exec.LookPath(cmd); err != nil {
return &ErrBackendUnavailable{}
return &ErrBackendUnavailable{
Detail: "unable to find an Undo v8.2.0+ installation on the current PATH"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the MinimumVersion value here would be nice, hoisting it to the start of this function.

`udbserver` is now in the `tools` directory - we don't need to worry about
supporting old directory layouts because older UDB will not support this Delve.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants