Open
Description
Is your feature request related to a problem? Please describe.
I am trying to implement native bindings to a library that extensively uses pointers to objects. I am trying to build custom views using the DebuggerDisplay and DebuggerTypeProxy attributes; however, no matter what I do, I cannot get the vscode debugger views to display the objects how I want. I have tried many combinations but to no avail. The debugger views just do not like native pointers at all.
Describe the solution you would like
I have run into a few issues with the debug views that seem unsatisfactory:
- The debugger view does not display the type of a pointer type at all (ex: Foo*). I have also noticed that many 'special' characters specified in the Type property of the DebuggerDisplayAttribute cause the type name for the variable to disappear in the same way: * being one of them. I think the type name should be displayed regardless of what characters the type string contains. I tested Foo* with visual studio and it correctly displays the type name
- For a pointer variable in the debug view (ex: Foo*) expanding the variable reveals a dereference operation. For what I am doing, this makes absolutely no sense and I would not like the view trying to dereference the pointer and show me the result. The pointers in question are a combination of some base structure fields and opaque pointers. Provide some sort of attribute or option to tell the debug view to not try and display a dereferenced pointer.
- If we try to apply the DebuggerTypeProxyAttribute to a pointer type at the assembly level, we can provide a custom view for the pointer by dereferencing the pointer properly for the application and providing the debug fields. Problem is that when you apply the DebuggerTypeProxyAttribute to a pointer type wherein the type itself is a structure, the view tries to provide a dereferenced 'raw view' of the pointer. Again, I don't want the view dereferencing the pointer and or trying to provide a raw view. Provide an option to completely disable the raw view display.
- I potentially want a custom type (that is not a pointer) to be viewable through the "view binary data" button so we can view the raw memory for the variable. I have tried almost everything to try and get that button to appear for my custom type to no avail. The button appears for pointer types and just about every other type, but there seems to be no way to tell the debug view how to get a pointer to memory for a custom type and display the button. Provide a way for a type to tell the debug view about a memory pointer it can use to open the binary memory view through the 'view binary data' button.
Applicable Scenarios
Better native pointer debug view support / customization
Describe alternatives you've considered
Trying to hack DebuggerTypeProxy & DebuggerDisplay attributes with different combinations