Skip to content
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

Add clrjit.natvis file #52668

Merged
merged 7 commits into from
May 14, 2021
Merged

Add clrjit.natvis file #52668

merged 7 commits into from
May 14, 2021

Conversation

kunalspathak
Copy link
Member

Add clrjit.natvis file for better debugging experience. There are lot of things we can add to this file, but I just included the important ones that I could think of and time permitted. I have added some pattern like LinkedList or Loop that someone else can refer and add entries to this file for the code they work on.

I am also not 100% sure of what could be useful information to display for each type of GenTree node, but from what I have, it should be easy to extend.

Here is the sample visualizer for jitstd::list<RefPosition> as well as RefPosition and the decomposition of registerAssignment inside it to show all the registers.

image

Unfortunately, natvis do not support typedefs or primitive types, so it will be hard to use it more broadly.

@kunalspathak
Copy link
Member Author

@dotnet/jit-contrib

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 12, 2021
Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

Looking good! A few suggestions

src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/CMakeLists.txt Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Outdated Show resolved Hide resolved
src/coreclr/jit/clrjit.natvis Show resolved Hide resolved
)

convert_to_absolute_path(JIT_NATVIS_SOURCE ${JIT_NATVIS_SOURCE})
add_linker_flag("/NATVIS:${JIT_NATVIS_SOURCE}")
Copy link
Member

Choose a reason for hiding this comment

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

All this natvis stuff is Windows-only

Copy link
Member Author

Choose a reason for hiding this comment

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

Took a stab at it. @jkoritzinsky , let me know if there is anything that is not correct.

Co-authored-by: Jeremy Koritzinsky <[email protected]>
@kunalspathak kunalspathak merged commit 7185031 into dotnet:main May 14, 2021
@@ -251,6 +251,10 @@ if (CLR_CMAKE_TARGET_WIN32)
vartype.h
)

# Append clrjit.natvis file
list (APPEND JIT_SOURCES
clrjit.natvis)
Copy link
Member Author

Choose a reason for hiding this comment

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

no, we still want it so ninja can rebuild when it changes.

Copy link

@cburnett707 cburnett707 left a comment

Choose a reason for hiding this comment

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

[#{rpNum,d} - {refType,en}]

@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants