-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added Natvis for some internal datalibrary types #179
Open
Tisten
wants to merge
5
commits into
wc-duck:master
Choose a base branch
from
Tisten:natvis
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d0c8d87
Added natvis to datalibrary
Tisten 83605a9
More explicit natvis and better formatting
Tisten 0db5842
More documentation and name changes
Tisten af10bc5
Merge branch 'Official_master' into natvis
Tisten 61f933d
Merge branch 'OfficialMaster' into natvis
Tisten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> | ||
<Type Name="dl_substr"> | ||
<DisplayString Encoding="Utf8">{str,[len]s8}</DisplayString> | ||
<StringView>str,[len]s8</StringView> | ||
</Type> | ||
<Type Name="dl_type_desc"> | ||
<DisplayString Condition="name >= (*ctx)->typedata_strings_size">Change g_DlDebuggingContext in watch window</DisplayString> | ||
<DisplayString Condition="member_count > 3">struct {(*ctx)->typedata_strings + name,s8b} {{{member_count,u} members}}</DisplayString> | ||
<DisplayString Condition="member_count > 2">struct {(*ctx)->typedata_strings + name,s8b} {{{*((*ctx)->member_descs + member_start)}; {*((*ctx)->member_descs + member_start + 1)}; {*((*ctx)->member_descs + member_start + 2)};}}</DisplayString> | ||
<DisplayString Condition="member_count > 1">struct {(*ctx)->typedata_strings + name,s8b} {{{*((*ctx)->member_descs + member_start)}; {*((*ctx)->member_descs + member_start + 1)};}}</DisplayString> | ||
<DisplayString>struct {(*ctx)->typedata_strings + name,s8b} {{{*((*ctx)->member_descs + member_start)};]</DisplayString> | ||
<Expand> | ||
<Item Name="[name]" ExcludeView="simple">(*ctx)->typedata_strings + name,s8</Item> | ||
<Item Name="[typeid]">(*ctx)->type_ids[this - (*ctx)->type_descs],X</Item> | ||
<Item Name="[comment]" Condition="comment!=0xFFFFFFFF" ExcludeView="simple">(*ctx)->typedata_strings + comment,s8</Item> | ||
<Synthetic Name="[members]"> | ||
<DisplayString Condition="member_count > 3">Count: {member_count,u}, {{{*((*ctx)->member_descs + member_start)}; {*((*ctx)->member_descs + member_start + 1)}; {*((*ctx)->member_descs + member_start + 2)}; ...}}</DisplayString> | ||
<DisplayString Condition="member_count > 2">Count: {member_count,u}, {{{*((*ctx)->member_descs + member_start)}; {*((*ctx)->member_descs + member_start + 1)}; {*((*ctx)->member_descs + member_start + 2)};}}</DisplayString> | ||
<DisplayString Condition="member_count > 1">Count: {member_count,u}, {{{*((*ctx)->member_descs + member_start)}; {*((*ctx)->member_descs + member_start + 1)};}}</DisplayString> | ||
<DisplayString>Count: {member_count,u}, {{{*((*ctx)->member_descs + member_start)};]</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>member_count</Size> | ||
<ValuePointer>(*ctx)->member_descs + member_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
<Item Name="[flags]" ExcludeView="simple">flags</Item> | ||
<Item Name="[size]" ExcludeView="simple">size[DL_PTR_SIZE_HOST]</Item> | ||
<Item Name="[alignment]" ExcludeView="simple">alignment[DL_PTR_SIZE_HOST]</Item> | ||
<Synthetic Name="[metadata]" Condition="metadata_count!=0"> | ||
<DisplayString>Count: {metadata_count,u}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>metadata_count</Size> | ||
<ValuePointer>(*ctx)->metadatas + metadata_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
</Expand> | ||
</Type> | ||
<Type Name="dl_member_desc"> | ||
<DisplayString Condition="name >= (*ctx)->typedata_strings_size">Change g_DlDebuggingContext in watch window</DisplayString> | ||
<DisplayString Condition="type == 0x0000">int8 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0100">int16 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0200">int32 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0300">int64 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0400">uint8 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0500">uint16 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0600">uint32 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0700">uint64 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0800">float {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0900">double {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0A00">enum:int8 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0B00">enum:int16 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0C00">enum:int32 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0D00">enum:int64 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0E00">enum:uint8 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0F00">enum:uint16 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1000">enum:uint32 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1100">enum:uint64 {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1200">const char* {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1300">ptr {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1400">struct {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1500">anypointer {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1600">anyarray {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0001">dl_array<int8> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0101">dl_array<int16> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0201">dl_array<int32> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0301">dl_array<int64> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0401">dl_array<uint8> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0501">dl_array<uint16> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0601">dl_array<uint32> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0701">dl_array<uint64> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0801">dl_array<float> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0901">dl_array<double> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0A01">dl_array<enum:int8> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0B01">dl_array<enum:int16> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0C01">dl_array<enum:int32> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0D01">dl_array<enum:int64> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0E01">dl_array<enum:uint8> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x0F01">dl_array<enum:uint16> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1001">dl_array<enum:uint32> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1101">dl_array<enum:uint64> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1201">dl_array<const char*> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1301">dl_array<ptr> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1401">dl_array<struct> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1501">dl_array<anypointer> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="type == 0x1601">dl_array<anyarray> {(*ctx)->typedata_strings + name,s8b}</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0002">int8 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0102">int16 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0202">int32 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0302">int64 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0402">uint8 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0502">uint16 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0602">uint32 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0702">uint64 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0802">float {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0902">double {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0A02">enum:int8 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0B02">enum:int16 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0C02">enum:int32 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0D02">enum:int64 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0E02">enum:uint8 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0F02">enum:uint16 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1002">enum:uint32 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1102">enum:uint64 {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1202">const char* {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1302">ptr {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1402">struct {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1502">anypointer {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x1602">anyarray {(*ctx)->typedata_strings + name,s8b}[{type>>16,u}]</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0403">uint8 {(*ctx)->typedata_strings + name,s8b}:{(type>>16)&0xFF,u}</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0503">uint16 {(*ctx)->typedata_strings + name,s8b}:{(type>>16)&0xFF,u}</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0603">uint32 {(*ctx)->typedata_strings + name,s8b}:{(type>>16)&0xFF,u}</DisplayString> | ||
<DisplayString Condition="(type & 0xFFFF) == 0x0703">uint64 {(*ctx)->typedata_strings + name,s8b}:{(type>>16)&0xFF,u}</DisplayString> | ||
<DisplayString>{(*ctx)->typedata_strings + name,s8b}, {(dl_type_atom_t)(type & 0xFF)}</DisplayString> | ||
<Expand> | ||
<Item Name="[name]">(*ctx)->typedata_strings + name,s8</Item> | ||
<Item Name="[comment]" Condition="comment!=0xFFFFFFFF" ExcludeView="simple">(*ctx)->typedata_strings + comment,s8</Item> | ||
<Item Name="[atom]">(dl_type_atom_t)(type & 0xFF)</Item> | ||
<Item Name="[storage]">(dl_type_storage_t)((type >> 8) & 0xFF)</Item> | ||
<Item Name="[flags]" ExcludeView="simple">flags</Item> | ||
<Item Name="[typeid]" Condition="type_id!=0">type_id,X</Item> | ||
<Item Name="[offset]" ExcludeView="simple">offset[DL_PTR_SIZE_HOST]</Item> | ||
<Item Name="[bitoffset]" Condition="(type&0xFF)==3" ExcludeView="simple">(type>>24)&0xFF,u</Item> | ||
<Item Name="[bitcount]" Condition="(type&0xFF)==3" ExcludeView="simple">(type>>16)&0xFF,u</Item> | ||
<Item Name="[size]" ExcludeView="simple">size[DL_PTR_SIZE_HOST]</Item> | ||
<Item Name="[alignment]" ExcludeView="simple">alignment[DL_PTR_SIZE_HOST]</Item> | ||
<Synthetic Name="[default values]" Condition="default_value_offset!=0xFFFFFFFF"> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>default_value_size</Size> | ||
<ValuePointer>(*ctx)->default_data + default_value_offset</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
<Synthetic Name="[metadata]" Condition="metadata_count!=0"> | ||
<DisplayString>Count: {metadata_count,u}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>metadata_count</Size> | ||
<ValuePointer>(*ctx)->metadatas + metadata_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
</Expand> | ||
</Type> | ||
<Type Name="dl_enum_desc"> | ||
<DisplayString Condition="name >= (*ctx)->typedata_strings_size">Change g_DlDebuggingContext in watch window</DisplayString> | ||
<DisplayString>{(*ctx)->typedata_strings + name,s8}</DisplayString> | ||
<Expand> | ||
<Item Name="[name]" ExcludeView="simple">(*ctx)->typedata_strings + name,s8</Item> | ||
<Item Name="[comment]" Condition="comment!=0xFFFFFFFF" ExcludeView="simple">(*ctx)->typedata_strings + comment,s8</Item> | ||
<Item Name="[storage]" ExcludeView="simple">storage</Item> | ||
<Item Name="[flags]" ExcludeView="simple">flags</Item> | ||
<Synthetic Name="[values]" Condition="value_count!=0"> | ||
<DisplayString>Count: {value_count,u}, [{*((*ctx)->enum_value_descs + value_start)}...]</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>value_count</Size> | ||
<ValuePointer>(*ctx)->enum_value_descs + value_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
<Synthetic Name="[aliases]" Condition="alias_count!=0"> | ||
<DisplayString>Count: {alias_count,u}, [{*((*ctx)->enum_alias_descs + alias_start)}...]</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>alias_count</Size> | ||
<ValuePointer>(*ctx)->enum_alias_descs + alias_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
<Synthetic Name="[metadata]" Condition="metadata_count!=0"> | ||
<DisplayString>Count: {metadata_count,u}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>metadata_count</Size> | ||
<ValuePointer>(*ctx)->metadatas + metadata_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
</Expand> | ||
</Type> | ||
<Type Name="dl_enum_value_desc"> | ||
<DisplayString Condition="main_alias >= (*ctx)->enum_alias_count">Change g_DlDebuggingContext in watch window</DisplayString> | ||
<DisplayString>{(*ctx)->enum_alias_descs + main_alias,na}</DisplayString> | ||
<Expand> | ||
<Item Name="[name]" ExcludeView="simple">(*ctx)->enum_alias_descs + main_alias,na</Item> | ||
<Item Name="[value]" ExcludeView="simple">value</Item> | ||
<Item Name="[comment]" Condition="comment!=0xFFFFFFFF" ExcludeView="simple">(*ctx)->typedata_strings + comment,s8</Item> | ||
<Synthetic Name="[metadata]" Condition="metadata_count!=0"> | ||
<DisplayString>Count: {metadata_count,u}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>metadata_count</Size> | ||
<ValuePointer>(*ctx)->metadatas + metadata_start</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
</Expand> | ||
</Type> | ||
<Type Name="dl_enum_alias_desc"> | ||
<DisplayString Condition="name >= (*ctx)->typedata_strings_size">Change g_DlDebuggingContext in watch window</DisplayString> | ||
<DisplayString>{(*ctx)->typedata_strings + name,s8}</DisplayString> | ||
<Expand> | ||
<Item Name="[name]" ExcludeView="simple">(*ctx)->typedata_strings + name,s8</Item> | ||
<Item Name="[value_index]" ExcludeView="simple">value_index</Item> | ||
</Expand> | ||
</Type> | ||
<Type Name="dl_context"> | ||
<Expand> | ||
<Synthetic Name="[types]"> | ||
<DisplayString>Size:{type_count}, Capacity:{type_capacity}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>type_count</Size> | ||
<ValuePointer>type_descs</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
<Synthetic Name="[enums]"> | ||
<DisplayString>Size:{enum_count}, Capacity:{enum_capacity}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>enum_count</Size> | ||
<ValuePointer>enum_descs</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Synthetic> | ||
</Expand> | ||
</Type> | ||
<Type Name="dl_array<*>"> | ||
<DisplayString>Size = {count}</DisplayString> | ||
<Expand> | ||
<ArrayItems> | ||
<Size>count</Size> | ||
<ValuePointer>data</ValuePointer> | ||
</ArrayItems> | ||
</Expand> | ||
</Type> | ||
</AutoVisualizer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am no fan of all of these globals but I can see that it can't really be done in natvis without at least one global :(
I would like the define to be DL_NATVIS_ENABLED as this relates to natvis and not some general debugging.
It should also be enough with one g_DlActiveNatvisCtx so that we don't pollute all structs with this CTX.
The comment above might need a bit of expansion as well on the fact that this context will be used when inspecting values via natvis.
One thing that could be worth considering is to add a DL_NATVIS_SCOPE(ctx) that can be put in the top-level functions, that with a tls might automate the setup of the global? Not sure how much "muck" that would add to the codebase however?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't access "global scope variables", only "type scoped globals" from natvis. In other words I need all the globals except g_DlDebuggingContext. I added g_DlDebuggingContext just so I can change a single pointer in the debugger when I want to inspect a different context, instead of manually having to change all five places.
I will improve the documentation about this and rename them to your liking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About making the natvis context TLS (or FLS) aware, this seems very exotic to me. If a developer uses different contexts per thread or fiber then I think they should make that adaptation in their own local version of the library. This is an open source library where such adaptations are easy to do, and thus I would prefer to only provide basic and common use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting globals to work as this doc says that it should work https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2022. But I also trust you on this one, just not a fan of polluting the structs with all these statics :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thought on the scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean a scope which can declare the global as extern and then assign it? Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of the statics neither. I guess it could be solved by adding a dll based natvis or something similar. But that is far past my ambitions in this case.