Skip to content

'cwd' option is not respected in launch.json #8084

Open
@andreasjhkarlsson

Description

@andreasjhkarlsson

Bug type: General

  • OS and Version: macOS 11.2.3
  • VS Code Version: 1.59.1
  • C/C++ Extension Version: 1.6.0

After updating to 1.6.0 of this extension the cwd option stopped working for all of my launch.json configs. Example config:

        {
            "name": "TEST",
            "request": "launch",
            "type": "cppdbg",
            "program": "/tmp/a.out",
            "args": [""],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}/components/Media/",
            "environment": [
                //{"name": "ASAN_OPTIONS", "value": "detect_container_overflow=0"} // Uncomment when using address sanitizier
            ], 
            "externalConsole": false,
            "MIMode": "lldb"
        },  

To verify I created a test program like:

#include <unistd.h>
#include <iostream>

int main()
{
char a[2048];
getcwd(a, 2048);
std::cout << a << std::endl;
}

which on 1.6.0 prints the incorrect "/private/tmp" when launching through vscode. If I manually downgrade to 1.5.1 I get the expected output (the actual cwd specified in the launch.json file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Visual StudioInherited from Visual StudiobugdebuggerregressionA bug that didn't exist in a previous release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions