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

改变 launch.json 中的 cwd 路径后,调试时找不到 C++ 源码 #203

Open
vrecluse opened this issue Jun 14, 2023 · 3 comments
Open
Labels

Comments

@vrecluse
Copy link

Xmake 版本

xmake v2.7.9+20230523

操作系统版本和架构

Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

描述问题

launch.json 配置如下

        {
            "name": "XMake Debug",
            "type": "xmake",
            "request": "launch",
            "target": "panda",
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}/build"
        }

调试时断点找不到源码,把 cwd 设置为 workspaceFolder 才能找到
image

但希望能在不同的工作路径下调试程序

期待的结果

修改cwd后,调试能够找到源码

工程配置

No response

附加信息和错误日志

No response

@vrecluse vrecluse added the bug label Jun 14, 2023
@vrecluse vrecluse changed the title 改变 launch.json 中的 cwd 路径后,调试时找不到源码 改变 launch.json 中的 cwd 路径后,调试时找不到 C++ 源码 Jun 14, 2023
@waruqi
Copy link
Member

waruqi commented Jun 14, 2023

set_rundir 可以自己 xmake.lua 直接配置

@vrecluse
Copy link
Author

vrecluse commented Jun 14, 2023

set_rundir 可以自己 xmake.lua 直接配置

set_rundir 后,如果不把 launch.js 中 cwd 配置删除,还是用的 cwd 路径
删了之后,源码用的似乎是绝对路径导致找不到源码(实际应该在 ./src/panda 而不是 /src/panda)
image

        {
            "name": "XMake Debug",
            "type": "xmake",
            "request": "launch",
            "target": "panda",
            "stopAtEntry": false
        }

@vrecluse
Copy link
Author

image
F5 运行会一直报这个错,也重新运行 xmake 重新编译过

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants