vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Get trash file after debug the multi-files c++ code

Open coherent17 opened this issue 2 years ago • 5 comments

Environment

  • OS and version: Windows_NT x64 10.0.22000
  • VS Code: 1.69.2(user setup)
  • C/C++ extension: C/C++ v1.12.0, C/C++ Extension Pack v1.2.0
  • OS and version of remote machine (if applicable): Windows11

Bug Summary and Steps to Reproduce

Bug Summary: Get trash file in debugging process.

Steps to Reproduce:

  1. Using ssh to the lab sever(linux), and debug the c++ code using gdb.
  2. Here is my setting in .vscode folder
  • c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}"
            ],
            "defines": [],
            "compilerPath": "/usr/local/bin/gcc",
            "cppStandard": "c++11",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}
  • settings.json
{
    "makefile.extensionOutputFolder": "./.vscode",
    "files.associations": {
        "iosfwd": "cpp",
        "iostream": "cpp",
        "ostream": "cpp"
    }
}
  • task.json
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "C/C++: g++ build active file",
            "command": "make",
            "args": [],
            "options": {
                "cwd": "${fileDirname}"
            },
        }
    ],
}
  • launch.json
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description":  "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: g++ build active file"
        }

    ]
}
  1. In the process of debugging, I got a garbage file(not created by me), and the content is the picture below: image

  2. Here is the extension installed in the vscode image

image

Other Extensions

No other extension

Additional Information

Thanks~

coherent17 avatar Jul 28 '22 13:07 coherent17

Do you repro the issue with 1.11.4 too?

Does a new trash file get created every time you start debugging? How do the name of the files change?

sean-mcmanus avatar Jul 28 '22 18:07 sean-mcmanus

Both release and pre-realease version generate trash file everytime, both the filename and the content are all the same as the picture I provided.

coherent17 avatar Jul 28 '22 18:07 coherent17

You mean the file is always named "2"? So there's only ever 1 trash file existing at a time or do they accumulate somehow?

sean-mcmanus avatar Jul 28 '22 20:07 sean-mcmanus

I delete the trash file every time, and it just keeps generating it everytime I debug it. Yes, the filename is "2", and the content is shown above.

coherent17 avatar Jul 29 '22 03:07 coherent17

I don't repro the issue. Are you able to repro it without building with a makefile?

sean-mcmanus avatar Jul 29 '22 18:07 sean-mcmanus

This issue has been closed because it needs more information and has not had recent activity.

github-actions[bot] avatar Oct 03 '22 11:10 github-actions[bot]