Skip to content

Conversation

kunalspathak
Copy link
Contributor

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
Contributor Author

@dotnet/jit-contrib

@ghost ghost 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
Contributor

@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

)

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

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
Contributor 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

# Append clrjit.natvis file
list (APPEND JIT_SOURCES
clrjit.natvis)
Copy link
Contributor 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