Skip to content

Port STL Visualizer to VS and MSVC repos

Anju del Moral Gonzalez edited this page Jun 22, 2021 · 2 revisions

To port the changes we have to follow a couple of steps. For all this changes I recommend using cmd since powershell trend to fail. Also for some reason all of this commands must be executed on the root of each repo or they will fail. Lastly most of this commands must be written with forward slash because backward don't work very well.

Adding the remote branch with the changes

First we have to add the remote repo with the next command

  • git remote add <name> <link>
  • <name> is the personal tag you want to identify it
  • <link> the address of their repo.
  • Example: git remote add Anju https://github.com/AnjuDel/STL.git

Saving the changes in a file

Invoking the next command will generate the file

  • git diff <foo> <bar> <path> > <file>
  • <foo> is a branch or commit and it must be the before changes version and probably is going to be the main branch from the stl repo.
  • <bar> is a branch or commit and it must be the after changes version don't forget to add the remote name before the branch for example Anju/stl_natvis.
  • <path> is the path on the file and exactly this stl/debugger/STL.natvis
  • <file> is the name of the file you want to generate.

Coping the chages into VS and msvc

Running this command will make the changes in each of the repos.

  • git apply -p3 --directory=<path> <file>
  • -p3 is important since the file will the changes will have this path stored a/stl/debugger/STL.natvis the -p3 removed the 3 elements of the left in this case it will remove a/stl/debugger
  • <path> is where the stl.natvis is stored for vs it will be src/vc/CppEE/src/Visualizers and for msvc it will be src/vctools/crt/github/stl/debugger
  • <file> is the name of the file created in the previous step, I highly recommend coping the file to root of each repo.

Requesting tests and builds on VS repo

Finally after pushing your changes in each repo is required to run some additional builds and tests on the vs repo. On the overview page you will see a message that says View <n> checks click on it and a list of tests and builds should pop up. Hit the button for queue in Request GlassTests (Debugger) and Request Perf DDRITs. After some time the GlassTests could fail. To check if the reason of this is our changes and fix the errors follow the next steps:

  • Open the Failure details menu and open the log for each test.
  • If the test mentions the stl.natvis the error was caused by us otherwise ignore the failure.
  • The most common error to see is that a specific visualizers is expected on a specific line. To fix this my recommendation is to open VS code in the next directory src/vc/CppEE/tests/NativeEE/NatCustomVisualizer
  • Once opened use the find tool to found the mismatched piece of code reported in the error.
  • Once you found it fix to the new correct matching line.

An example that I have ran previously was opening /src/vc/CppEE/tests/NativeEE/NatCustomVisualizer/EETest1.baseline.x64.xml and changing

  • Natvis: %GLASSDIR%\visualizers\stl.natvis(1067,6)

to

  • Natvis: %GLASSDIR%\visualizers\stl.natvis(1243,6)