farre / midas

A GDB/MI Visual Studio Code Debug Adapter
MIT License
29 stars 1 forks source link

Wrong option passed to 'rr replay' for process that never execed #175

Closed sj-raima closed 8 months ago

sj-raima commented 10 months ago

Background: Each process that rr records can be replayed using the -p . This will do the replay from the moment the forked process execed (execve or similar call). However, some processes never calls execve. This is the case for a daemon where the main process forks a child. The child continues and the parent exits.

In this case we want to debug the child from the moment the child was forked. The option -f has to be done instead of -p . The Midas extension always does the last. Below I have shown one example from rr ps:

$ rr ps | grep 3518593
3518593 3518557 0       <command not shown for a daemon started>
3518594 3518593 0       (forked without exec)

Picking the last one and debugging it show the following in the terminal:

$ /usr/bin/rr replay -h 127.0.0.1 -s 50505 -p 3518594 -k ctest-5
Process 3518594 never exec()ed. Try 'rr ps', or use '-f'.

Manually issuing the following command in the terminal allows me to debug the child from Midas:

$ /usr/bin/rr replay -h 127.0.0.1 -s 50505 -f 3518594 -k ctest-5
theIDinside commented 10 months ago

Thank you for bringing this issue to our attention!

This issue has been resolved in pre-release version 0.19.8. The current pre-release (version 0.19.X) comes with reliability, performance and stability updates and a custom command interpreter for GDB. It also has breaking changes with respect to how debug sessions are configured (all this is mentioned in the README of the extension). I'll close this issue, once pre-release moves into release version, which should be some time soon when I'm confident that it doesn't introduce major issues to the debug adapter.

I encourage you to try to pre-release version! If you don't know how to switch; go to the extension list, find midas extension, and click the icon right next to the gear icon (to the left of the gear icon). Auto-complete for the new launch.json configuration should make the move fairly easy (just remove old settings, hit ctrl+space inside launch.json and select Midas rr debug session).

bild

sj-raima commented 10 months ago

Thanks for quick fix. I can confirm this have been fixed in 0.19.8.