Skip to content

Commit 1026d88

Browse files
committed
2 parents 70c03f7 + 0949251 commit 1026d88

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,38 @@ The flat mode skips all groups and only shows one layer, producing a more compac
3434

3535
## How it works
3636

37-
Struct Layout uses Clang LibTooling internally to parse the C++ files and extract the memory layout information.
37+
Struct Layout can use different systems to parse the C++ files and extract the memory layout information. Depending on the complexity and quirks of the build system and Visual Studio setup one option will be more convinent than the others. The method used can be changed in the [Extension Options Window](https://github.com/Viladoman/StructLayout/wiki/Configurations)
3838

3939
When a Layout request is made the extension does the following:
4040
+ Retrieve the active document and cursor position.
41-
+ Extract the relevant file and project properties (cl or nmake).
42-
1. Include directories
43-
2. Force includes
44-
3. Preprocessor definitions
45-
4. Exclude directories
46-
+ Add the extra parameters from the extension options.
47-
+ Trigger the LayoutParser (Clang libtooling application) with all the arguments gathered.
41+
+ Extract the relevant project context.
42+
+ Add/Override any extra parameters from the extension options.
43+
+ Trigger the selected LayoutParser with all the arguments gathered.
4844
+ Visualize the results or print any issues found in the *StructLayout Output Pane*.
4945

46+
### Clang Libtooling
47+
48+
This method will process the file location through a Clang LibTooling executable which will parse the current file and headers. This method can give really accurate results as it retrieves the data directly from the Clang AST but it will need the exact build context to be able to properly understand all the code.
49+
50+
When a query to the clang libtooling is triggered the extension will try to gather the following data from the active project and configuration:
51+
1. Include directories
52+
2. Force includes
53+
3. Preprocessor definitions
54+
4. Exclude directories
55+
56+
### PDB
57+
58+
This method takes advantage of the fact that the pdb (Program DataBase) will most likely contain all the layout information for all user defined types. This application uses the DIA SDK (Debug Interface Access) to open and query the pdb. This system can be useful if our setup is not ready to be compiled with a Clang compiler, the build system is quite complex hitting some corner cases or we have some MSVC specific code. The caveat is that we would need to compile the projects before performing any queries keeping the pdbs up to date.
59+
5060
## Documentation
5161
- [Configurations and Options](https://github.com/Viladoman/StructLayout/wiki/Configurations)
5262
- [Using Unreal Engine](https://github.com/Viladoman/StructLayout/wiki/Unreal-Engine-Configuration)
5363
- [Building the VSIX](https://github.com/Viladoman/StructLayout/wiki/Building-the-VSIX)
5464

5565
## References
56-
- [Visual Studio 2019](https://visualstudio.microsoft.com/vs/)
66+
- [Visual Studio](https://visualstudio.microsoft.com/vs/)
5767
- [LLVM](http://llvm.org/)
68+
- [DIA SDK](https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/debug-interface-access-sdk)
5869

5970
## Contributing
6071
This project is open to code contributions.

0 commit comments

Comments
 (0)