microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

"Error" in provided XML document STL.natvis #8351

Open astrelsky opened 3 years ago

astrelsky commented 3 years ago

Bug type: Debugger

Describe the bug

To Reproduce Please include a code sample and launch.json configuration. Steps to reproduce the behavior:

  1. Build LLVM, clang and lldb with libxml2 for Windows *huge pain (llvm-projects fault here really. Necessary for both lldb-mi and for an appropriate version of python).
  2. Build the lldb-mi with the toolchain just built.
  3. Compile c++ program via clang -glldb main.cpp -o main.exe
  4. launch the program with the launch.json configuration provided below
  5. Change tabs to the debug console and see the error at the top. It appears that the Priority attribute for Type isn't being handled.
{
    "name": "(lldb) Launch",
    "type": "cppdbg",
    "request": "launch",
    "program": "${workspaceFolder}/main.exe",
    "targetArchitecture": "x64",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "MIMode": "lldb",
    "miDebuggerPath": "lldb-mi.exe",
    "externalConsole": false,
    "showDisplayString": true,
    "visualizerFile": "C:\\Users\\{user}\\.vscode\\extensions\\ms-vscode.cpptools-1.7.0\\debugAdapters\\vsdbg\\bin\\Visualizers\\STL.natvis",
}

Additional context This is on a system without internet. As such I am unable to provide any log files. Please also disregard any typos in the provided launch config as it was typed by hand.

I can't seem to find where the visualizer files are being handled in the repo. I would like to be able to patch fix it into the extension on my local machine if at all possible but if I need to wait for another release it is understandable.

WardenGnaw commented 3 years ago

Natvis.cs is s where we parse the natvis file for cppdbg.

the STL.natvis in the vsdbg folder uses the natvis parser from CppEE.dll which is a superset of the parser in MIEngine due to the limited capabilities of visualization we have with GDB/LLDB.

astrelsky commented 3 years ago

Natvis.cs is s where we parse the natvis file for cppdbg.

the STL.natvis in the vsdbg folder uses the natvis parser from CppEE.dll which is a superset of the parser in MIEngine due to the limited capabilities of visualization we have with GDB/LLDB.

Thank you very much. Would it be possible to have this ignored? Ultimately I think the entire type element would have to be dropped but I see it as a much better alternative then just dropping the entire file. I will most likely end up regex removing all of the problematic types so that I can get some type markup.