debugging Visual studio代码- lldb调试 rust ,更改项目目录

0qx6xfy6  于 2022-11-14  发布在  其他
关注(0)|答案(1)|浏览(218)

你好我有以下状态:
货物 rust eclipse 项目:/Users/daniel1302/www/aws-alarm/工作区目录:'/用户/丹尼尔1302/www
我有以下调试配置:

{
            "type": "lldb",
            "request": "launch",
            "name": "rust/aws-alarm",
            "cwd": "/Users/daniel1302/www/aws-alarm/",
            "cargo": {
                "args": [
                    "build",
                    "--lib"
                ],
            },
            "program": "${cargo:program}",
            "args": [],
            "env": {
                "AWS_PROFILE": "sf_MFA",
                "AWS_REGION": "us-east-1"
            },
        }

当我开始项目调试时,我可以看到:

Running `cargo build --lib --message-format=json`...
error: could not find `Cargo.toml` in `/Users/daniel1302/www/releases` or any parent directory

问题是,cwd指令不会更改项目目录。
你知道我如何改变货物项目目录吗?

pod7payv

pod7payv1#

我通过设置cargo arg --manifest-path找到了解决方法:

"configurations": [
{
...
    "cargo": {
        "args": [
           "build",
           "--bin=importer",
           "--package=cprices",
           "--manifest-path=${workspaceFolder}/cprices/Cargo.toml"
        ],
...

相关问题