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 basic natvis visualizations for some VM types #52853

Merged
merged 6 commits into from
May 19, 2021

Conversation

jkoritzinsky
Copy link
Member

Add some natvis visualizations for SString and BaseHolder<T> to get the natvis files started and the infrastructure hooked up so others can add more visualizations for CoreCLR types if desired.

Contributes to #52772

@ghost
Copy link

ghost commented May 17, 2021

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Add some natvis visualizations for SString and BaseHolder<T> to get the natvis files started and the infrastructure hooked up so others can add more visualizations for CoreCLR types if desired.

Contributes to #52772

Author: jkoritzinsky
Assignees: -
Labels:

area-Infrastructure

Milestone: -

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for doing this.

@@ -465,6 +456,10 @@ function(add_jit jitName)
${JIT_ARCH_LINK_LIBRARIES}
)

if (CLR_CMAKE_HOST_WIN32)
link_natvis_sources_for_target(${jitName} PRIVATE clrjit.natvis)
Copy link
Member

Choose a reason for hiding this comment

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

what is the purpose of PRIVATE?

Copy link
Member Author

Choose a reason for hiding this comment

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

The PRIVATE makes sure to keep the natvis linked only to the jit dlls and not to dlls that link to the jit dlls in the CMake build. See here in the CMake docs: https://cmake.org/cmake/help/latest/command/target_link_libraries.html#id3

<Type Name="HolderBase&lt;*&gt;">
<DisplayString>{*m_value}</DisplayString>
<Expand>
<ExpandedItem>m_value</ExpandedItem>
Copy link
Member

Choose a reason for hiding this comment

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

do you need ExpandedItem for this? May be a screenshot will help. You can also consider adding StringView for better copy paste experience.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since HolderBase doesn't usually hold a string, I think StringView would be the wrong element to add here. I think DisplayString handles that case. I'll change it to m_value.

Copy link
Member

Choose a reason for hiding this comment

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

Ok..And then what is the purpose of ExpandedItem? Isn't DisplayString sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

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

ExpandedItem basically removes a level of indirection in the expanded tree when looking in the locals/auto/watch view, so when the holder object is expanded, we get directly to the held value.

@ghost
Copy link

ghost commented May 18, 2021

Hello @jkoritzinsky!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@jkoritzinsky
Copy link
Member Author

Wasm failures are unrelated.

@jkoritzinsky jkoritzinsky merged commit d49bcbe into dotnet:main May 19, 2021
@jkoritzinsky jkoritzinsky deleted the vm-natvis branch May 19, 2021 23:43
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants