0

I have set the compilation option -fstandalone-debug, but still cannot view the string content in vscode with clangd & CodeLLDB.

#include <iostream>
#include <string>

using namespace std;

int main() {
  string s = "hello world";
  cout << s << endl;
  return 0;
}

Here is the debug console output:

Console is in 'commands' mode, prefix expressions with '?'.
Launching: D:\dev\vsc\test\test.exe
Launched process 39752 from 'D:\dev\vsc\test\test.exe'
error: test.exe :: Class 'std::strong_ordering' has a member 'less' of type 'std::strong_ordering' which does not have a complete definition.
error: test.exe :: Class 'std::partial_ordering' has a member 'less' of type 'std::partial_ordering' which does not have a complete definition.
error: test.exe :: Class 'std::weak_ordering' has a member 'less' of type 'std::weak_ordering' which does not have a complete definition.
error: test.exe :: Class 'locale::_Locimp' has a base class 'locale::facet' which does not have a complete definition.
p s
(std::basic_string<char,std::char_traits<char>,std::allocator<char> >) error: summary string parsing error

My development environment is as follows:

PS C:\Users\iop18> clang --version
clang version 20.1.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Scoop\apps\llvm\20.1.4\bin
PS C:\Users\iop18> lldb --version
lldb version 20.1.4

And here is the vscode jsons:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "clang++ build",
            "type": "shell",
            "command": "clang++",
            "args": [
                "-std=c++17",
                "-Wall",
                "-Wextra",
                "-g",
                "-fstandalone-debug",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": ["$gcc"],
            "presentation": {
                "reveal": "always",
                "panel": "new"
            }
        }
    ]
}
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug",
            "program": "${workspaceFolder}/test.exe",
            "args": [],
            "preLaunchTask":"clang++ build",
            "cwd": "${workspaceFolder}"
        }
    ]
}

I tried running lldb only in the command line and the result was the same.

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.