Time Travel Debugging: How to do it in C#?
Asked Answered
I

2

8

In C++/Windbg, there is now Time Travel Debugging.

What is the path to do this in C#?

Note: I am looking for TTD from a C# app created in visual studio. Whether the TTD is in visual studio or in windbg (or some other tool) does not matter to me. The point is full TTD.

Intellitrace is not TTD. Intellitrace is an event and state capturing system. TTD is a "movie" of a debug dump, that allows you to capture the trace at run time, on any machine, and then replay your code in the debugger, as it executed during the run. You get full debug support, breakpoints, all variables, as it runs, and can play fwd and backward. TTD gives the full power of the interactive debugger, but disconnected in time and place from the actual execution being debugged.

NOTE TO SO COMMUNITY: MS is taking votes on this:

Isosceles answered 9/10, 2017 at 23:1 Comment(13)
You can move the pointer while the application is in break mode which changes the line that gets executed (forwards and backwards). It's not entirely the same thing but I doubt that exists for C# yet.Geter
Isn't it what IntelliTrace does ? learn.microsoft.com/en-us/visualstudio/debugger/intellitraceZoophilia
You have added many tags which make the question unclear. Are you looking for C# time travelling in WinDbg? Then tag it WinDbg. Are you looking for C# time travelling in Visual Studio? Then tag it Visual-Studio.Griffey
To add to @JeroenVannevel's comment, you can also use the Call Stack Window to jump between different methods and view values within those methods.Aculeus
@JeroenVannevel and others: First watch the video of the new time travel debugging (TTD) in windbg on C++, and then you will see that your suggestions are not on topic. Thanks!Isosceles
Downvoting and voting to close, because a) You have still not clarified the tags, although requested. b) You have not added a description at which point of the process you're stuck. Can't you record? Can't you replay? Are the buttons disabled? Do you get an exception? Is it because you can't see source code? It's too broad and impossible to answer. c) you say C++/WinDbg although the linked articles never says it's limited to C++Griffey
@Aybe Intellitrace appears to be quite different than TTD (intellitrace seems to be a small fraction of TTD). From what I can see, intellitrace only captures configured events. TTD is a full debug capture, that lets me move, line by line, through all the sources, as they were executed during the capture. TTD is a car, and intellitrace is a skateboard, from my review of both.Isosceles
@ThomasWeller I am looking for TTD from a C# app created in visual studio. Whether the TTD is in visual studio or in windbg does not matter to me. TTD is what I am after. Will update OP in a moment.Isosceles
Can't you configure IntelliSense ? (note: I never use it)Zoophilia
@Aybe Intellisense is good, but is not TTD. See the new TTD for C++ and drool w desire.Isosceles
@ThomasWeller fwiw, this is open w MS at this new url: developercommunity.visualstudio.com/content/idea/351585/… (the old url is : visualstudio.uservoice.com/forums/121579-visual-studio-ide/… )Isosceles
blogs.msdn.microsoft.com/dotnet/2019/01/25/…Dupin
@rauland Thank you! That is certainly a step forward, but it is NOT the real TTD thing. The real thing would let me replay in the VS debugger the run time execution of the app, fwd and backward, with visibility to variables, etc.Isosceles
A
5

Time Travel Debugging is a feature in Windbg, in VS, it doesn't have the same feature, but it has been submitted to the product team

NOTE ABOVE LINK HAS MIGRATED: and is now here: https://developercommunity.visualstudio.com/content/idea/351585/time-travel-debugging.html

You could vote and add your comment there.

In addition, like Aybe's suggestion, IntelliTrace would be a simliar tool in VS IDE which could help you analyze code issue.

Alchemy answered 10/10, 2017 at 6:57 Comment(4)
Jack, if you inline the links, the text becomes much more readable. SO has two ways of linking text. I edited the answer with both ways.Griffey
Jack, your post is not really an answer, so I did not accept, but am voting up because it is at least a step in the right direction. RE intellitrace, that appears to be far short of the TDD for C++, from my review.Isosceles
@Jonesome, I know, but you could vote that user voice and add your comment there, the product team would view it after it got enough vote. I also vote it:). In addition, VS also has the diagnostic tool and profiler tool, maybe it could help you debug app if you would use the VS: msdn.microsoft.com/en-us/library/mt210448.aspx and blogs.msdn.microsoft.com/devops/2015/01/16/…, since it really has no the same tools in VS now, just vote that feature request is the path I could provide. Have a nice day.Alchemy
@JackZhai-MSFT Thanks! I see the uservoice thread moved, so I updated your post above w new link.Isosceles
E
0

Yes nearly everything that works in a WinDbg Preview live debugging session for managed code works for a TTD session. You can use the SOS debugging extension (sos.dll) running in 64 bit mode to debug managed code using TTD in WindDbg Preview. There is an error in 32 bit mode that is being investigated.

See link for more details … https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging-managed-code

Evyn answered 20/10, 2017 at 17:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.