You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,27 +34,38 @@ The flat mode skips all groups and only shows one layer, producing a more compac
34
34
35
35
## How it works
36
36
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)
38
38
39
39
When a Layout request is made the extension does the following:
40
40
+ 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.
48
44
+ Visualize the results or print any issues found in the *StructLayout Output Pane*.
49
45
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
+
50
60
## Documentation
51
61
-[Configurations and Options](https://github.com/Viladoman/StructLayout/wiki/Configurations)
0 commit comments