Using WinDbg with TTD enabled, how to play back to the moment of creation of some managed object?
Lets say I do have its address obtained using !clrstack -a or !dso
Play back to the moment of creation of some managed object in WinDbg TTD
160 Views Asked by Serg Kryvonos At
1
There are 1 best solutions below
Related Questions in CLR
- Windows Error Reporting doesn't generate mini dump for a .NET 4 application sometimes
- Where exactly is .NET Runtime (CLR), JIT Compiler located?
- SQL CLR Exception when trying to convert PDF
- Obtain non-explicit field offset
- Test if a given object reference is valid
- msclr is not being used
- Mixed mode assembly is built against version xxxx
- “CLR detected an Invalid Program” when compiling a constructor for List<T>
- Set only second argument type in generic method
- Where would the code produced by the JIT would reside
- .NET Framework compatibility issue
- Using the new source provided by microsoft would it be possible to create a variant of the CLR?
- Deadlocked in w3wp for a WCF website. Unable to find source of Issue
- At what point in time does an instance of a C# class with a generic Type parameter lose awareness of its "generic"-ness?
- Type '<Module>' from assembly ... contains more methods than the current implementation allows
Related Questions in WINDBG
- BindingExpression error displayed in WinDbg
- What is ntdll!_SEH_epilog ? Is the first occurence of it the place where the real issue is?
- Windbg Crash Dump Stack Trace Keeps Every Over Function
- Reading ntdll.dll + offset results in an access violation
- WinDbg MEM_COMMIT is at 1GB, eeheap is showing 150MB, can't find remaining memory
- WinDbg symbol proxy
- Deadlocked in w3wp for a WCF website. Unable to find source of Issue
- Windbg for memory analysis using mimikatz ERROR [CRYPTO] acquire keys
- Analizing crash dump
- How to debug Access Violation that it thrown from windows library ucrtbase?
- Problems using dbgrpc on Windows7
- .NET application handle leak, how to locate the source?
- Source code lines number in stack trace for asp.net application in WinDbg
- How to check if the Microsoft symbol server is available, and contact them if not?
- Failed to find runtime clr.dll to use sos
Related Questions in HISTORICAL-DEBUGGING
- Will IntelliTrace(tm) (historical debugging) be available for unmanaged c++ in future versions of Visual Studio?
- intellitrace standalone recorder
- Proper code for storing previous values (and refreshing them)
- Visual Studio 2019 Historical Debugging not working with Fips
- Is there a way to generate an Intellitrace file from a TFS Build?
- Play back to the moment of creation of some managed object in WinDbg TTD
- What can we do to make Microsoft add IntelliTrace to VS 2010 Professional Edition?
- IntelliTrace Standalone Collector OutputPath empty
- Intellitrace is not collecting data for process 'XXX.vshost.exe'
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are several ways of doing this. If you have the address of the object and want to go back to its creation you can use a ba (break on access). When an object is created the Method Table address is written into the first word (4 bytes for 32-bit, 8 bytes for 64-bit). So adding a breakpoint per write access and going backwards will stop at the object creation. Another way is to add breakpoints pointing to all constructors of the object and also going backwards. Also notice that all of this can also be done by a 'dx' command filtering by breakpoint address or constructor call.
Imagine you have this output:
Approach 1: And you want to stop when this object is created you can use (for 32-bit use w4):
Using 'dx' (notice that the address must be in C++ format, starting wit '0x'):
Again, for 32-bit use address+4 on the second parameter. The option -g will show in a grid format.
Approach 2:
Get the address(es) of the constructors by listing the methods table of the class:
You may simply set the breakpoint at the 'Entry' address (or use !sos.bpmd) and go backwards:
Or use 'dx' to show all occasions where the code was called (note that the code was again adjusted to look like C++ '0x' and also that is in quotes):
Hope it works for you.