Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

${workspaceFolder} is not resolved in cmake.debugConfig #3711

Open
upcliujie opened this issue Apr 18, 2024 · 9 comments
Open

${workspaceFolder} is not resolved in cmake.debugConfig #3711

upcliujie opened this issue Apr 18, 2024 · 9 comments
Labels
more info needed More info is needed from the community for us to properly triage and investigate.

Comments

@upcliujie
Copy link
Contributor

Brief Issue Summary

settings.json:

"cmake.debugConfig": {
        "environment": [
            {
                "name": "LD_LIBRARY_PATH",
                "value": "${workspaceFolder}/build/bin"
            },
        ]
    },

gdb can't get LD_LIBRARY_PATH environment

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@v-frankwang
Copy link
Collaborator

v-frankwang commented Apr 24, 2024

@upcliujie I still can't reproduce the problem after following your tips, am I going about it the wrong way? Are you able to give some advice?

steps:

  1. Create a folder named "Test" and open it with VS Code.
  2. Setting.json is set as follows:
    "cmake.debugConfig": {
    "environment": [
    {
    "name": "LD_LIBRARY_PATH",
    "value": "${workspaceFolder}/build/bin"
    },
    ]
    },
  3. Executing the CMake: debug command
  4. Configured the kit to be Visual Studio Enterprise 2022 IntPreview -amd64

Actual results:
image

@v-frankwang v-frankwang added more info needed More info is needed from the community for us to properly triage and investigate. and removed triage labels Apr 24, 2024
@upcliujie
Copy link
Contributor Author

@v-frankwang The environment variable read on the executable file is incorrect,${workspaceFolder} is not be expanded.

@v-frankwang
Copy link
Collaborator

v-frankwang commented Apr 30, 2024

@upcliujie Thank you very much for your reply! The environment LD_LIBRARY_PATH is recognized correctly. Is this the same problem as you described? Or can you provide a simple project that reproduces this problem.
image

@upcliujie
Copy link
Contributor Author

@v-frankwang
图片
图片
图片

@gcampbell-msft
Copy link
Collaborator

@upcliujie How are you executing the code? Are you executing the code using the CMake debug button? If so, I think you're right that this is a possible bug and we should put it on the backlog to investigate.

@upcliujie
Copy link
Contributor Author

@upcliujie How are you executing the code? Are you executing the code using the CMake debug button? If so, I think you're right that this is a possible bug and we should put it on the backlog to investigate.

Yes,I execute the code using the CMake debug button.

@v-frankwang
Copy link
Collaborator

v-frankwang commented May 6, 2024

@upcliujie @gcampbell-msft This bug has been fixed.
image

@geertj
Copy link
Contributor

geertj commented May 14, 2024

Slightly broadening this feature request, hope that is okay. It would be nice if ${workspaceFolder} is expanded as in cmake.debugConfig.miDebuggerPath as well. Our use case is that we have a gdb wrapper that is local to a package.

@v-frankwang
Copy link
Collaborator

@geertj This issue has been fixed, and for the issue you raised you can go ahead and create a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Status: Triage Needed
Development

No branches or pull requests

4 participants