Viladoman / StructLayout

Visual Studio Extension for C++ struct memory layout visualization
MIT License
480 stars 22 forks source link

Visual Studio 2022 support #28

Closed roalz closed 2 years ago

roalz commented 2 years ago

Can this extension be updated to support Visual Studio 2022?

Viladoman commented 2 years ago

Yes! I will do it. I want to[ do a full upgrade pass, upgrade the parser to a newer version of Clang ( 13 ), also use its 64 bit version, and generate also a new VS2022 version of the extension.

Hopefully I can do it soon. Thanks for the interest.

Carandiru0 commented 2 years ago

I tried installing it on visual studio 2022:

2021-12-01 9:03:51 AM - Microsoft VSIX Installer
2021-12-01 9:03:51 AM - -------------------------------------------
2021-12-01 9:03:51 AM - vsixinstaller.exe version:
2021-12-01 9:03:51 AM - 17.0.5226-preview5
2021-12-01 9:03:51 AM - -------------------------------------------
2021-12-01 9:03:51 AM - Command line parameters:
2021-12-01 9:03:51 AM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,X:\Downloads\StructLayout.vsix
2021-12-01 9:03:51 AM - -------------------------------------------
2021-12-01 9:03:51 AM - Microsoft VSIX Installer
2021-12-01 9:03:51 AM - -------------------------------------------
2021-12-01 9:03:51 AM - Initializing Install...
2021-12-01 9:03:52 AM - Extension Details...
2021-12-01 9:03:52 AM -     Identifier         : StructLayout.ae9caa76-a538-4c6c-bff5-9e0a61e6b728
2021-12-01 9:03:52 AM -     Name               : Struct Layout
2021-12-01 9:03:52 AM -     Author             : Ramon Viladomat
2021-12-01 9:03:52 AM -     Version            : 0.4.6
2021-12-01 9:03:52 AM -     Description        : C++ struct memory layout viewer
2021-12-01 9:03:52 AM -     Locale             : en-US
2021-12-01 9:03:52 AM -     MoreInfoURL        : https://github.com/Viladoman/StructLayout
2021-12-01 9:03:52 AM -     InstalledByMSI     : False
2021-12-01 9:03:52 AM -     SupportedFrameworkVersionRange : [4.5,)
2021-12-01 9:03:52 AM - 
2021-12-01 9:03:52 AM -     SignatureState     : Unsigned
2021-12-01 9:03:52 AM -     Supported Products : 
2021-12-01 9:03:52 AM -         Microsoft.VisualStudio.Community
2021-12-01 9:03:52 AM -             Version : [15.0,17.0)
2021-12-01 9:03:52 AM -             ProductArchitecture : x86
2021-12-01 9:03:52 AM - 
2021-12-01 9:03:52 AM -     References         : 
2021-12-01 9:03:52 AM -     Prerequisites      : 
2021-12-01 9:03:52 AM -         -------------------------------------------------------
2021-12-01 9:03:52 AM -         Identifier   : Microsoft.VisualStudio.Component.CoreEditor
2021-12-01 9:03:52 AM -         Name         : Visual Studio core editor
2021-12-01 9:03:52 AM -         Version      : [15.0,17.0)
2021-12-01 9:03:52 AM - 
2021-12-01 9:03:52 AM - Signature Details...
2021-12-01 9:03:52 AM -     Extension is not signed.
2021-12-01 9:03:52 AM - 
2021-12-01 9:03:52 AM - Searching for applicable products...
2021-12-01 9:03:52 AM - Found installed product - Global Location
2021-12-01 9:03:52 AM - Found installed product - Visual Studio Community 2022 Current
2021-12-01 9:03:52 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Viladoman commented 2 years ago

I did the VS 2022 version last weekend. I hope to push a new version within the next few days.

Carandiru0 commented 2 years ago

Awesome!

Viladoman commented 2 years ago

Just released the 2022 version

I haven't tested it extensively yet, hopefully there are no hidden surprises.

Carandiru0 commented 2 years ago

Hey just tried it out. I had to add _MT to the preprocessor arguments to get around an error. Any struct I have tried to "Show Struct Layout" does not seem to load. The struct layout window. at the bottom just says processing... No errors are reported, I also tried adding -v to the Extra Parser Args and enable warnings for more detail/logging but it did not change the output logging.

I have only this:

[08:11:29] Capturing configuration from VS projects...
[08:11:29] Looking for structures at C:\MinCity\MinCity\voxelState.h:19:21...
[08:11:29] CLANG ARGUMENTS:  -x c++ -m64 -std=c++2a -DWIN32_LEAN_AND_MEAN -DVC_EXTRALEAN -D__AVX2__ -D__AVX__ -D__FMA__ -D_XM_AVX2_INTRINSICS_ -D_XM_AVX_INTRINSICS_ -D_XM_SSE4_INTRINSICS_ -DVK_USE_PLATFORM_WIN32_KHR -DVK_NO_PROTOTYPES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_ENABLE_ATOMIC_ALIGNMENT_FIX -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING -D_HAS_EXCEPTIONS=0 -D_STD_ATOMIC_ALWAYS_USE_CMPXCHG16B=1 -D_MT -IX:\tbb\include -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt" -IInclude\um -IX:\nuklear-master -IX:\Vulkan\glfw\include -IX:\VulkanSDK\Include -IX:\Vulkan\Vookoo\include -IX:\fmt -IX:\FMOD\api\core\inc -I"C:\Documents\Visual Studio 2017\Projects" -IX:\density-master\src -includepch.h -working-directory=C:\MinCity\MinCity -v
[08:11:29] GENERATED FILE: c:\users\jason tully\appdata\local\microsoft\visualstudio\17.0_429fcad3\extensions\m5cmk13q.dhk\Generated\tempResult.slbin

That generated file was not there when I navigated to that folder aswell.

Viladoman commented 2 years ago

The generated file print is a notification to the path provided to the clang libtooling application ( it is not the actual result yet ). I will change that name or just remove that print and only show it up when there are issues with the path to avoid confusion.

About the issue itself. It looks like the clang libtooling app just hanged and never terminated. I think I have a repro case myself. I will have a look, sorry for the inconvenience.