a partial-multiverse model of time travel for debugging · a partial-multiverse model of time...
TRANSCRIPT
![Page 1: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/1.jpg)
A Partial-Multiverse Modelof Time Travelfor Debugging
RubyConf 2014
Brock [email protected]@optoro.com
![Page 2: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/2.jpg)
ABSTRACT:
Ever type 'next' into your debugger and then realize you should have used 'step'? Or perhaps invoked a method that you wish you could take back? Regret no more! Just turn the clock back a few ticks and begin again! With only a few restrictions and side-effects we will learn how to construct and use a time machine.
WARNING: Time travel may cause zombies.
![Page 3: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/3.jpg)
Debuggers
![Page 4: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/4.jpg)
Byebug(demo)
![Page 5: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/5.jpg)
How does THAT work‽(demo)
![Page 6: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/6.jpg)
Sweet
![Page 7: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/7.jpg)
OK. What could be better?
![Page 8: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/8.jpg)
MAD SCIENCE
![Page 9: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/9.jpg)
The Idea
![Page 10: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/10.jpg)
fork() the universe during 'next'
![Page 11: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/11.jpg)
Suspend the child fork
![Page 12: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/12.jpg)
Keep track of all created child forks
![Page 13: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/13.jpg)
Upon 'prev', grab the most recent child fork
![Page 14: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/14.jpg)
Resume (time-travel!) the previous child fork
![Page 15: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/15.jpg)
Unix Processes & Forks(demo)
![Page 16: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/16.jpg)
So... "fork" byebug!(demo)
![Page 17: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/17.jpg)
Limitations
![Page 18: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/18.jpg)
Can only travel back to checkpoints
![Page 19: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/19.jpg)
"Partial" time-travel
![Page 20: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/20.jpg)
Zombies
![Page 21: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/21.jpg)
Might crash the multiverse throughmemory exauhstion, I guess
![Page 22: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/22.jpg)
References
https://github.com/TomOnTime/timetravelpdb
![Page 23: A Partial-Multiverse Model of Time Travel for Debugging · A Partial-Multiverse Model of Time Travel for Debugging RubyConf 2014 Brock Wilcox awwaiid@thelackthereof.org bwilcox@optoro.com](https://reader033.vdocuments.us/reader033/viewer/2022060514/5f845b9928c5492141218478/html5/thumbnails/23.jpg)
THE END